Changeset 118 in Main for trunk/Server/http.c
- Timestamp:
- Sep 21, 2024, 6:03:27 PM (8 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/http.c
r104 r118 19 19 #include <winsock2.h> 20 20 #else 21 #ifdef USE_POLL 22 #include <poll.h> 23 #else 21 24 #include <sys/select.h> 25 #endif 22 26 #endif 23 27 … … 46 50 char cbuf[2]; 47 51 int phase = 0; 52 53 #ifdef USE_POLL 54 struct pollfd pollfds[1]; 55 pollfds[0].fd = sock; 56 pollfds[0].events = POLLIN | POLLPRI; 57 #else 48 58 fd_set fds; 59 #endif 49 60 50 61 bool bad = false; … … 64 75 65 76 while(1) { 77 #ifndef USE_POLL 66 78 FD_ZERO(&fds); 67 79 FD_SET(sock, &fds); … … 69 81 tv.tv_sec = 5; 70 82 tv.tv_usec = 0; 83 #endif 71 84 #ifndef NO_SSL 72 85 if(ssl == NULL || !SSL_has_pending(ssl)) { 73 86 #endif 87 #ifdef USE_POLL 88 int n = poll(pollfds, 1, 5000); 89 #else 74 90 #ifdef __HAIKU__ 75 91 int n = select(32, &fds, NULL, NULL, &tv); 76 92 #else 77 93 int n = select(FD_SETSIZE, &fds, NULL, NULL, &tv); 94 #endif 78 95 #endif 79 96 if(n <= 0) {
Note:
See TracChangeset
for help on using the changeset viewer.