1 |
slords |
1.1 |
Add three FD_SETSIZE changes to main/network.c (#125258) |
2 |
|
|
|
3 |
|
|
--- php-4.3.8/main/network.c.fdsetsize |
4 |
|
|
+++ php-4.3.8/main/network.c |
5 |
|
|
@@ -287,7 +287,7 @@ |
6 |
|
|
fd_set wset; |
7 |
|
|
fd_set eset; |
8 |
|
|
|
9 |
|
|
- if (timeout == NULL) { |
10 |
|
|
+ if (timeout == NULL || sockfd > FD_SETSIZE) { |
11 |
|
|
/* blocking mode */ |
12 |
|
|
return connect(sockfd, addr, addrlen); |
13 |
|
|
} |
14 |
|
|
@@ -1010,6 +1010,8 @@ |
15 |
|
|
int retval; |
16 |
|
|
struct timeval timeout, *ptimeout; |
17 |
|
|
|
18 |
|
|
+ if (sock->socket > FD_SETSIZE) return; |
19 |
|
|
+ |
20 |
|
|
FD_ZERO(&fdr); |
21 |
|
|
FD_SET(sock->socket, &fdr); |
22 |
|
|
sock->timeout_event = 0; |
23 |
|
|
@@ -1187,6 +1189,8 @@ |
24 |
|
|
struct timeval tv = {0, 0}; |
25 |
|
|
char buf; |
26 |
|
|
|
27 |
|
|
+ if (fd > FD_SETSIZE) return 1; |
28 |
|
|
+ |
29 |
|
|
/* logic: if the select call indicates that there is data to |
30 |
|
|
* be read, but a read returns 0 bytes of data, then the socket |
31 |
|
|
* has been closed. |