From b9ce8714631318f3252354534ac49fd4aa72dcb0 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Tue, 7 Oct 2008 23:15:02 +0000 Subject: Changed the handling of read/write errors in Curl_perform() to allow a a fresh connection to be made in such cases and the request retransmitted. This should fix test case 160. Added test case 1079 in an attempt to test a similar connection dropping scenario, but as a race condition, it's hard to test reliably. --- lib/transfer.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/transfer.c b/lib/transfer.c index 8d2d0db82..2f4ce692d 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1848,11 +1848,9 @@ Transfer(struct connectdata *conn) /* The EINTR is not serious, and it seems you might get this more often when using the lib in a multi-threaded environment! */ if(SOCKERRNO == EINTR) - ; - else + continue; #endif - done = TRUE; /* no more read or write */ - continue; + return CURLE_RECV_ERROR; /* indicate a network problem */ case 0: /* timeout */ default: /* readable descriptors */ @@ -2465,15 +2463,16 @@ CURLcode Curl_perform(struct SessionHandle *data) if(res == CURLE_OK) { res = Transfer(conn); /* now fetch that URL please */ - if(res == CURLE_OK) { + if((res == CURLE_OK) || (res == CURLE_RECV_ERROR)) { bool retry = Curl_retry_request(conn, &newurl); if(retry) { + res = CURLE_OK; follow = FOLLOW_RETRY; if (!newurl) res = CURLE_OUT_OF_MEMORY; } - else { + else if (res == CURLE_OK) { /* * We must duplicate the new URL here as the connection data may * be free()ed in the Curl_done() function. We prefer the newurl -- cgit v1.2.3