androiddump: Have a timeout with non-blocking sockets on Windows too
After ae9da806947f66d2ea8bf77ca9c2ccdcd89f5483 androiddump properly checks to see if sockets timeout on Windows (recv doesn't set errno on Windows), so we can use a timeout instead of stalling. Fix #20526
This commit is contained in:
parent
b7060b5125
commit
0396917654
@ -394,8 +394,6 @@ static void useSndTimeout(socket_handle_t sock) {
|
||||
|
||||
static void useNonBlockingConnectTimeout(socket_handle_t sock) {
|
||||
#ifdef _WIN32
|
||||
/* On Windows, we set a timeout for the non-blocking connection
|
||||
* and have no timeout on the blocking connection. */
|
||||
int res_snd;
|
||||
int res_rcv;
|
||||
const DWORD socket_timeout = SOCKET_RW_TIMEOUT_MS;
|
||||
@ -420,11 +418,7 @@ static void useNormalConnectTimeout(socket_handle_t sock) {
|
||||
int res_snd;
|
||||
int res_rcv;
|
||||
#ifdef _WIN32
|
||||
/* On Windows there is no timeout on the blocking connection, which
|
||||
* means that the error handling from recv(), etc. is different than
|
||||
* on UN*X. (If the socket timeout on Windows were the same as UN*X,
|
||||
* we would need to test WSAGetLastError() in a number of places.) */
|
||||
const DWORD socket_timeout = 0;
|
||||
const DWORD socket_timeout = SOCKET_RW_TIMEOUT_MS;
|
||||
unsigned long non_blocking = 0;
|
||||
|
||||
res_snd = setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (const char *) &socket_timeout, sizeof(socket_timeout));
|
||||
|
Loading…
x
Reference in New Issue
Block a user