When expecting to receive a number of bytes during socks connect,
treat an early connection close as error.
Reported-by: Joshua Rogers
Closes #18883
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;