mirror of
https://github.com/curl/curl.git
synced 2026-01-26 15:03:21 +00:00
tests/server: replace errno with SOCKERRNO in sockfilt, socksd, sws
To correctly read the winsock2 result code on Windows.
Follow-up to de2126b1821fecbc1f66715714cb34c5c2d14ec4 #5241
Ref: 5e855bbd18 (r38507132)
Ref: #14854
Closes #16553
This commit is contained in:
parent
d251ecb5c8
commit
adcfd4fb3e
@ -1081,11 +1081,11 @@ static bool juggle(curl_socket_t *sockfdp,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
} while((rc == -1) && ((error = errno) == EINTR));
|
||||
} while((rc == -1) && ((error = SOCKERRNO) == EINTR));
|
||||
|
||||
if(rc < 0) {
|
||||
logmsg("select() failed with error: (%d) %s",
|
||||
error, strerror(error));
|
||||
error, sstrerror(error));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@ -740,7 +740,7 @@ static bool incoming(curl_socket_t listenfd)
|
||||
logmsg("signalled to die, exiting...");
|
||||
return FALSE;
|
||||
}
|
||||
} while((rc == -1) && ((error = errno) == EINTR));
|
||||
} while((rc == -1) && ((error = SOCKERRNO) == EINTR));
|
||||
|
||||
if(rc < 0) {
|
||||
logmsg("select() failed with error: (%d) %s",
|
||||
|
||||
@ -869,7 +869,8 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
|
||||
logmsg("Got %zu bytes from client", got);
|
||||
}
|
||||
|
||||
if((got == -1) && ((EAGAIN == errno) || (EWOULDBLOCK == errno))) {
|
||||
if((got == -1) && ((SOCKERRNO == EAGAIN) ||
|
||||
(SOCKERRNO == EWOULDBLOCK))) {
|
||||
int rc;
|
||||
fd_set input;
|
||||
fd_set output;
|
||||
@ -891,7 +892,7 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
|
||||
do {
|
||||
logmsg("Wait until readable");
|
||||
rc = select((int)sock + 1, &input, &output, NULL, &timeout);
|
||||
} while(rc < 0 && errno == EINTR && !got_exit_signal);
|
||||
} while(rc < 0 && SOCKERRNO == EINTR && !got_exit_signal);
|
||||
logmsg("readable %d", rc);
|
||||
if(rc)
|
||||
got = 1;
|
||||
@ -1567,7 +1568,7 @@ static void http_connect(curl_socket_t *infdp,
|
||||
|
||||
do {
|
||||
rc = select((int)maxfd + 1, &input, &output, NULL, &timeout);
|
||||
} while(rc < 0 && errno == EINTR && !got_exit_signal);
|
||||
} while(rc < 0 && SOCKERRNO == EINTR && !got_exit_signal);
|
||||
|
||||
if(got_exit_signal)
|
||||
break;
|
||||
@ -2387,7 +2388,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
do {
|
||||
rc = select((int)maxfd + 1, &input, &output, NULL, &timeout);
|
||||
} while(rc < 0 && errno == EINTR && !got_exit_signal);
|
||||
} while(rc < 0 && SOCKERRNO == EINTR && !got_exit_signal);
|
||||
|
||||
if(got_exit_signal)
|
||||
goto sws_cleanup;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user