]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
- Bug #2107803 (http://curl.haxx.se/bug/view.cgi?id=2107803) "no
authorDaniel Stenberg <daniel@haxx.se>
Mon, 29 Sep 2008 12:22:10 +0000 (12:22 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 29 Sep 2008 12:22:10 +0000 (12:22 +0000)
  CURLINFO_REDIRECT_URL in multi mode" also contained a patch that fixed the
  problem.

CHANGES
RELEASE-NOTES
lib/multi.c

diff --git a/CHANGES b/CHANGES
index 9d2c2eda66618110ac753d2ad7e77ecb08a7ff29..035efb5b267c196eb080c8bac4d39c58c5584877 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,11 @@
 
                                   Changelog
 
+Daniel Stenberg (29 Sep 2008)
+- Bug #2107803 (http://curl.haxx.se/bug/view.cgi?id=2107803) "no
+  CURLINFO_REDIRECT_URL in multi mode" also contained a patch that fixed the
+  problem.
+  
 Daniel Stenberg (25 Sep 2008)
 - Emanuele Bovisio submitted bug report #2126435. We fixed the HTTP Digest
   auth code to not behave badly when getting a blank realm with
index 2ddecf450199f465377bab6faa2bfd1b310ad04a..dc93e9f22a436e93d6fc52e6812b0dd20bb0d5aa 100644 (file)
@@ -28,6 +28,7 @@ This release includes the following bugfixes:
  o thread-safety issues addressed for NSS-powered libcurls
  o removed the use of mktime() and gmtime(_r)() in date parsing and conversions
  o HTTP Digest with a blank realm did wrong
+ o CURLINFO_REDIRECT_URL didn't work with the multi interface
 
 This release includes the following known bugs:
 
index 0fd1aa15b8dec71f2034bdde0182413860c0e82d..6eda8c1c8d0b993f433208e24bed6852e19d755e 100644 (file)
@@ -1310,7 +1310,8 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
         /* Check if we can move pending requests to send pipe */
         checkPendPipeline(easy->easy_conn);
 
-        /* When we follow redirects, must to go back to the CONNECT state */
+        /* When we follow redirects or is set to retry the connection, we must
+           to go back to the CONNECT state */
         if(easy->easy_handle->req.newurl || retry) {
           if(!retry) {
             /* if the URL is a follow-location and not just a retried request
@@ -1335,6 +1336,18 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
         }
         else {
           /* after the transfer is done, go DONE */
+
+          /* but first check to see if we got a location info even though we're
+             not following redirects */
+          if (easy->easy_handle->req.location) {
+            newurl = easy->easy_handle->req.location;
+            easy->easy_handle->req.location = NULL;
+            easy->result = Curl_follow(easy->easy_handle, newurl, FOLLOW_FAKE);
+            if (easy->result)
+              free(newurl);
+            break;
+          }
+
           multistate(easy, CURLM_STATE_DONE);
           result = CURLM_CALL_MULTI_PERFORM;
         }