Fixed checking the socket if there is data waiting in the cache
Use Curl_pp_moredata() in Curl_pp_multi_statemach() to check if there is more data to be received, rather than the socket state, as a task could hang waiting for more data from the socket itself.
This commit is contained in:
parent
1dac29fa83
commit
296b9a5af0
@ -102,6 +102,10 @@ CURLcode Curl_pp_statemach(struct pingpong *pp, bool block)
|
|||||||
else
|
else
|
||||||
interval_ms = 0; /* immediate */
|
interval_ms = 0; /* immediate */
|
||||||
|
|
||||||
|
if(Curl_pp_moredata(pp))
|
||||||
|
/* We are receiving and there is data in the cache so just read it */
|
||||||
|
rc = 1;
|
||||||
|
else
|
||||||
rc = Curl_socket_ready(pp->sendleft?CURL_SOCKET_BAD:sock, /* reading */
|
rc = Curl_socket_ready(pp->sendleft?CURL_SOCKET_BAD:sock, /* reading */
|
||||||
pp->sendleft?sock:CURL_SOCKET_BAD, /* writing */
|
pp->sendleft?sock:CURL_SOCKET_BAD, /* writing */
|
||||||
interval_ms);
|
interval_ms);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user