Index: lib/multi.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/multi.c,v
retrieving revision 1.60
diff -u -r1.60 multi.c
--- lib/multi.c	10 Jan 2005 11:42:20 -0000	1.60
+++ lib/multi.c	10 Jan 2005 23:59:56 -0000
@@ -342,7 +342,7 @@
           gotourl = strdup(easy->easy_handle->change.url);
           if(gotourl) {
             easy->easy_handle->change.url_changed = FALSE;
-            easy->result = Curl_follow(easy->easy_handle, gotourl);
+            easy->result = Curl_follow(easy->easy_handle, gotourl, FALSE);
             if(CURLE_OK == easy->result)
               easy->state = CURLM_STATE_CONNECT;
             else
@@ -518,7 +518,7 @@
             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);
+              easy->result = Curl_follow(easy->easy_handle, newurl, FALSE);
             if(CURLE_OK == easy->result) {
               easy->state = CURLM_STATE_CONNECT;
               result = CURLM_CALL_MULTI_PERFORM;
Index: lib/transfer.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/transfer.c,v
retrieving revision 1.261
diff -u -r1.261 transfer.c
--- lib/transfer.c	5 Dec 2004 23:59:32 -0000	1.261
+++ lib/transfer.c	10 Jan 2005 23:59:57 -0000
@@ -1742,9 +1742,11 @@
  * as given by the remote server and set up the new URL to request.
  */
 CURLcode Curl_follow(struct SessionHandle *data,
-                     char *newurl) /* this 'newurl' is the Location: string,
+                     char *newurl, /* this 'newurl' is the Location: string,
                                       and it must be malloc()ed before passed
                                       here */
+                     bool retry) /* set TRUE if this is a request retry as
+                                    opposed to a real redirect following */
 {
   /* Location: redirect */
   char prot[16]; /* URL protocol string storage */
@@ -1758,8 +1760,9 @@
     return CURLE_TOO_MANY_REDIRECTS;
   }
 
-  /* mark the next request as a followed location: */
-  data->state.this_is_a_follow = TRUE;
+  if(!retry)
+    /* mark the next request as a followed location: */
+    data->state.this_is_a_follow = TRUE;
 
   data->set.followlocation++; /* count location-followers */
 
@@ -2063,7 +2066,7 @@
       res = Curl_done(conn, res);
       if(CURLE_OK == res) {
         char *gotourl = strdup(data->change.url);
-        res = Curl_follow(data, gotourl);
+        res = Curl_follow(data, gotourl, FALSE);
         if(res)
           free(gotourl);
       }
@@ -2086,6 +2089,7 @@
   CURLcode res2;
   struct connectdata *conn=NULL;
   char *newurl = NULL; /* possibly a new URL to follow to! */
+  bool retry = FALSE;
 
   data->state.used_interface = Curl_if_easy;
 
@@ -2119,6 +2123,8 @@
         res = Transfer(conn); /* now fetch that URL please */
         if(res == CURLE_OK) {
 
+          retry = FALSE;
+
           if((conn->keep.bytecount+conn->headerbytecount == 0) &&
              conn->bits.reuse) {
             /* We got no data and we attempted to re-use a connection. This
@@ -2135,6 +2141,7 @@
                                         prevent i.e HTTP transfers to return
                                         error just because nothing has been
                                         transfered! */
+            retry = TRUE;
           }
           else
             /*
@@ -2174,7 +2181,7 @@
        */
 
       if((res == CURLE_OK) && newurl) {
-        res = Curl_follow(data, newurl);
+        res = Curl_follow(data, newurl, retry);
         if(CURLE_OK == res) {
           newurl = NULL;
           continue;
Index: lib/transfer.h
===================================================================
RCS file: /cvsroot/curl/curl/lib/transfer.h,v
retrieving revision 1.20
diff -u -r1.20 transfer.h
--- lib/transfer.h	24 Nov 2004 16:11:36 -0000	1.20
+++ lib/transfer.h	10 Jan 2005 23:59:57 -0000
@@ -26,7 +26,7 @@
 CURLcode Curl_pretransfer(struct SessionHandle *data);
 CURLcode Curl_pretransfersec(struct connectdata *conn);
 CURLcode Curl_posttransfer(struct SessionHandle *data);
-CURLcode Curl_follow(struct SessionHandle *data, char *newurl);
+CURLcode Curl_follow(struct SessionHandle *data, char *newurl, bool retry);
 CURLcode Curl_readwrite(struct connectdata *conn, bool *done);
 void Curl_single_fdset(struct connectdata *conn,
                        fd_set *read_fd_set,
