mirror of
https://github.com/curl/curl.git
synced 2026-04-13 12:41:42 +08:00
socks: handle premature close
When expecting to receive a number of bytes during socks connect, treat an early connection close as error. Reported-by: Joshua Rogers Closes #18883
This commit is contained in:
parent
4a6bdd5899
commit
089afd78cb
@ -254,8 +254,14 @@ static CURLproxycode socks_recv(struct socks_state *sx,
|
||||
curl_easy_strerror(result));
|
||||
return CURLPX_RECV_CONNECT;
|
||||
}
|
||||
else if(!nread) /* EOF */
|
||||
else if(!nread) { /* EOF */
|
||||
if(Curl_bufq_len(&sx->iobuf) < min_bytes) {
|
||||
failf(data, "Failed to receive SOCKS response, "
|
||||
"proxy closed connection");
|
||||
return CURLPX_RECV_CONNECT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
*done = TRUE;
|
||||
return CURLPX_OK;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user