aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-10-07 23:15:02 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-10-07 23:15:02 +0000
commitb9ce8714631318f3252354534ac49fd4aa72dcb0 (patch)
tree13071a6e2552b2438ca97e2bb1bd9a550073c590 /lib/transfer.c
parent0bd78e1cd86718a7a85a1df0e22bf634a99f811b (diff)
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.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c11
1 files changed, 5 insertions, 6 deletions
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