1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

http-proxy: deal with EAGAIN

... the previous code would reset the header length wrongly (since
5113ad0424). This makes test 1060 reliable again.

Also: make sws send even smaller chunks of data to increase the
likeliness of this happening.
This commit is contained in:
Daniel Stenberg 2017-06-16 17:20:43 +02:00
parent e9422bc193
commit 12ccaed2a5
2 changed files with 4 additions and 8 deletions

View File

@ -311,6 +311,7 @@ static CURLcode CONNECT(struct connectdata *conn,
return result; return result;
s->tunnel_state = TUNNEL_CONNECT; s->tunnel_state = TUNNEL_CONNECT;
s->perline = 0;
} /* END CONNECT PHASE */ } /* END CONNECT PHASE */
check = Curl_timeleft(data, NULL, TRUE); check = Curl_timeleft(data, NULL, TRUE);
@ -328,8 +329,6 @@ static CURLcode CONNECT(struct connectdata *conn,
{ /* READING RESPONSE PHASE */ { /* READING RESPONSE PHASE */
int error = SELECT_OK; int error = SELECT_OK;
s->perline = 0;
while(s->keepon && !error) { while(s->keepon && !error) {
ssize_t gotbytes; ssize_t gotbytes;

View File

@ -1194,12 +1194,12 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
responsesize = count; responsesize = count;
do { do {
/* Ok, we send no more than 200 bytes at a time, just to make sure that /* Ok, we send no more than N bytes at a time, just to make sure that
larger chunks are split up so that the client will need to do multiple larger chunks are split up so that the client will need to do multiple
recv() calls to get it and thus we exercise that code better */ recv() calls to get it and thus we exercise that code better */
size_t num = count; size_t num = count;
if(num > 200) if(num > 20)
num = 200; num = 20;
retry: retry:
written = swrite(sock, buffer, num); written = swrite(sock, buffer, num);
@ -1211,9 +1211,6 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
sendfailure = TRUE; sendfailure = TRUE;
break; break;
} }
else {
logmsg("Sent off %zd bytes", written);
}
/* write to file as well */ /* write to file as well */
fwrite(buffer, 1, (size_t)written, dump); fwrite(buffer, 1, (size_t)written, dump);