ad some documentation

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@977 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/xacc-12-patch
Linas Vepstas 28 years ago
parent 99d8b14847
commit 9c146238bf

@ -4,8 +4,9 @@
*
* FUNCTION:
* Implements the infrastructure for the displayed table.
* This is just a sample hack for printing html. Its cheesey,
* for several reasons:
* This is just a sample hack for printing html to a file,
* or by acting as a web server. Its cheesey, for several
* reasons:
*
* (1) HTML should never be put in the same file as C code.
* Some sort of template file should be used.
@ -17,6 +18,9 @@
* get the financial data straight from the engine,
* not from the register.
*
* (3) The so-called "webserver" has less intelligence
* than a mosquito.
*
* But this code is fun, so what the hey.
*
*
@ -181,10 +185,12 @@ xaccTableWebServeHTML (Table * table, unsigned short port)
char buff[255];
int cnt;
/* don't slow down the parent, fork into background */
pid = fork();
if (0 < pid) return; /* parent */
CHKERR (pid, "cant fork");
/* create a socket */
listen_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
CHKERR (listen_fd, "cant listen");
@ -210,7 +216,7 @@ xaccTableWebServeHTML (Table * table, unsigned short port)
accept_fd = accept (listen_fd, &clientsock, &clientaddrsize);
CHKERR (rc, "cant accept");
/* count, for content-length */
/* count the number of chars, for content-length */
cnt = xaccTablePrintHTML (table, "/dev/null");
sprintf (buff,
"HTTP/1.0 200 OK\n"

Loading…
Cancel
Save