aboutsummaryrefslogtreecommitdiff
path: root/src/Sockets.c
diff options
context:
space:
mode:
authorgoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-09-21 14:59:37 +0000
committergoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-09-21 14:59:37 +0000
commitb72c001cf30767b0a12cfa816ec47b944ecc1d74 (patch)
tree5bb2fbc2632aacf6697096d10b449967f7f6e511 /src/Sockets.c
parentd459e03bae0f4757a19986c5559641f1c51831a1 (diff)
Bug fixes.
Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@76 1faa4e14-9dd3-4be0-9f0e-ffe519881164
Diffstat (limited to 'src/Sockets.c')
-rw-r--r--src/Sockets.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/Sockets.c b/src/Sockets.c
index 9ed6a7a..3b00005 100644
--- a/src/Sockets.c
+++ b/src/Sockets.c
@@ -312,7 +312,7 @@ int HTTP_Write(httpRequest *request, const char *buffer, size_t count)
connection = (httpSocket *)request->connection;
- if(connection->state = open)
+ if(connection->state == open)
{
FD_ZERO (&this_set);
done = 0;
@@ -454,12 +454,19 @@ int HTTP_Read(httpRequest *request, char *buffer, size_t count)
connection = (httpSocket *)request->connection;
- /* Currently don't do anything fancy. */
- retval = recv(connection->filedes, buffer, count,MSG_NOSIGNAL);
+ if(connection->state == open)
+ {
+ /* Currently don't do anything fancy. */
+ retval = recv(connection->filedes, buffer, count,MSG_NOSIGNAL);
#ifdef HTTP_DEBUG
- fprintf (stderr, "Read: `%s'\n", buffer);
+ fprintf (stderr, "Read: `%s'\n", buffer);
#endif
+ }
+ else
+ {
+ retval = -1;
+ }
return retval;
}
@@ -604,7 +611,7 @@ static void SocketDestroy(httpSocket *this)
{
if(this)
{
- if(this->state = open)
+ if(this->state == open)
{
SocketClose(this);
}