aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2002-01-07 14:57:01 +0000
committertradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2002-01-07 14:57:01 +0000
commit1aa278b784ae6ced606731e4622c2c331ad8de63 (patch)
tree4bc2579c3ff638dbe2a7a7d109cbd25583ebb36e
parentb15861c403cd215efed3bebd3787d1804c90e584 (diff)
Replaced sleep(3) by select(2) to make it compile under windoofs.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@149 1faa4e14-9dd3-4be0-9f0e-ffe519881164
-rw-r--r--src/http.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/http.c b/src/http.c
index b585585..9d88252 100644
--- a/src/http.c
+++ b/src/http.c
@@ -14,6 +14,12 @@
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -92,6 +98,7 @@ int HTTP_ReadFromClient(cGH *cctkGH, void *connection)
int request_buffer_length;
char *request_buffer;
char *tmp;
+ struct timeval timeout = {1, 0};
int found_eoh;
int failure_count;
@@ -121,8 +128,8 @@ int HTTP_ReadFromClient(cGH *cctkGH, void *connection)
CCTK_WARN(1, "Got 0 bytes when waiting for end of HTTP request header");
if(failure_count < 3)
{
+ select (0, NULL, NULL, NULL, &timeout);
failure_count++;
- sleep(1);
}
else
{