diff options
author | goodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2000-09-21 09:31:12 +0000 |
---|---|---|
committer | goodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2000-09-21 09:31:12 +0000 |
commit | 1332446b87c6822bbc1ffdc0db2fb3e409749203 (patch) | |
tree | 09e6f97410704c02c2ea1d0726f90c8f7de3180c /src/http.c | |
parent | db8e32396434e839819e65add9747f4038b7bcbf (diff) |
Reworked the socket layer a bit to detect errors when writing to a socket and
take appropriate action. Now it marks the socket closed on most errors, waits
till it can write if the buffer is full, or splits the message up if the message
was too big for the socket.
Tom
git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@72 1faa4e14-9dd3-4be0-9f0e-ffe519881164
Diffstat (limited to 'src/http.c')
-rw-r--r-- | src/http.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -77,7 +77,7 @@ static void DestroyArgument(httpArg *argument); @endhistory @@*/ -int HTTP_ReadFromClient(cGH *cctkGH, int filedes) +int HTTP_ReadFromClient(cGH *cctkGH, void *connection) { int retval; int keepalive; @@ -87,14 +87,14 @@ int HTTP_ReadFromClient(cGH *cctkGH, int filedes) InitialiseRequest(&request); - request.filedes = filedes; + request.connection = connection; nbytes = HTTP_Read(&request, buffer, MAXMSG); if (nbytes < 0) { /* Read error. */ - perror ("read"); + perror ("HTTP_Read"); CCTK_Abort(cctkGH, EXIT_FAILURE); } else if (nbytes == 0) @@ -669,7 +669,7 @@ static int InitialiseRequest(httpRequest *request) /* Initialise the private data */ - request->filedes = -1; + request->connection = NULL; request->headers = NULL; request->arguments = NULL; |