diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-01-29 22:31:06 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-01-29 22:31:06 +0000 |
commit | 8dbaf534c89764100028137c3633f9fc6d38a5bd (patch) | |
tree | ffba7c7f72953e4b0c6630f110eb8d10fa1b2387 /lib/multi.c | |
parent | 91f483c59144b4630699bbf260a431ac071e963b (diff) |
Using the multi interface, and doing a requsted a re-used connection that
gets closed just after the request has been sent failed and did not re-issue
a request on a fresh reconnect like the easy interface did. Now it does!
(define CURL_MULTIEASY, run test case 160)
Diffstat (limited to 'lib/multi.c')
-rw-r--r-- | lib/multi.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/multi.c b/lib/multi.c index f569c281a..e4773d06d 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -506,19 +506,24 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles) Curl_done(&easy->easy_conn, easy->result); } - /* after the transfer is done, go DONE */ else if(TRUE == done) { + char *newurl; + bool retry = Curl_retry_request(easy->easy_conn, &newurl); /* call this even if the readwrite function returned error */ Curl_posttransfer(easy->easy_handle); /* When we follow redirects, must to go back to the CONNECT state */ - if(easy->easy_conn->newurl) { - char *newurl = easy->easy_conn->newurl; - easy->easy_conn->newurl = NULL; + if(easy->easy_conn->newurl || retry) { + if(!retry) { + /* if the URL is a follow-location and not just a retried request + then figure out the URL here */ + newurl = easy->easy_conn->newurl; + easy->easy_conn->newurl = NULL; + } easy->result = Curl_done(&easy->easy_conn, CURLE_OK); if(easy->result == CURLE_OK) - easy->result = Curl_follow(easy->easy_handle, newurl, FALSE); + easy->result = Curl_follow(easy->easy_handle, newurl, retry); if(CURLE_OK == easy->result) { easy->state = CURLM_STATE_CONNECT; result = CURLM_CALL_MULTI_PERFORM; @@ -529,6 +534,7 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles) free(newurl); } else { + /* after the transfer is done, go DONE */ easy->state = CURLM_STATE_DONE; result = CURLM_CALL_MULTI_PERFORM; } |