Changeset 269
- Timestamp:
- 11/10/04 21:49:11 (9 years ago)
- Location:
- trunk/wifidog
- Files:
-
- 2 modified
-
ChangeLog (modified) (1 diff)
-
libhttpd/protocol.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog/ChangeLog
r261 r269 1 1 # $Header$ 2 3 2004-11-10 Alexandre Carmel-Veilleux <acv@acv.ca> 4 * libhttpd/protocol.c: select() based timeout. 2 5 3 6 2004-10-31 Alexandre Carmel-Veilleux <acv@acv.ca> -
trunk/wifidog/libhttpd/protocol.c
r253 r269 37 37 #include "httpd_priv.h" 38 38 39 40 39 int _httpd_net_read(sock, buf, len) 41 40 int sock; … … 46 45 return( recv(sock, buf, len, 0)); 47 46 #else 48 return( read(sock, buf, len)); 47 /*return( read(sock, buf, len));*/ 48 /* XXX Select based IO */ 49 50 int nfds; 51 fd_set readfds; 52 struct timeval timeout; 53 54 FD_ZERO(&readfds); 55 FD_SET(sock, &readfds); 56 timeout.tv_sec = 10; 57 timeout.tv_usec = 0; 58 nfds = sock + 1; 59 60 nfds = select(nfds, &readfds, NULL, NULL, &timeout); 61 62 if (nfds > 0) { 63 return(read(sock, buf, len)); 64 } else { 65 return(-1); 66 } 49 67 #endif 50 68 }
