]> sjero.net Git - wget/commitdiff
Don't abort when len > contlen, when we set it that way.
authorMicah Cowan <micah@cowan.name>
Tue, 17 Jun 2008 04:49:15 +0000 (21:49 -0700)
committerMicah Cowan <micah@cowan.name>
Tue, 17 Jun 2008 04:49:15 +0000 (21:49 -0700)
src/ChangeLog
src/http.c

index ae04028d43bfe7c87bbbe528ed8858253c5fefde..deee0232f34d4ebe67aae6f077374bd497046165 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-16  Micah Cowan  <micah@cowan.name>
+
+       * http.c (http_loop): When hstat.len is higher than the
+       successfully completed content's length, but it's because we
+       _set_ it that way, don't abort.
+
 2008-06-13  Micah Cowan  <micah@cowan.name>
 
        * build_info.c: ENABLE_NTLM, not HAVE_NTLM; distinguish OpenSSL
index 919d7593b16d0005f1d4a20783e241daf386cab5..78e57373976fb2d2bb663f84ef5bc00cf317b06e 100644 (file)
@@ -2800,10 +2800,18 @@ Remote file exists.\n\n"));
               printwhat (count, opt.ntry);
               continue;
             }
-          else
+          else if (hstat.len != hstat.restval)
             /* Getting here would mean reading more data than
                requested with content-length, which we never do.  */
             abort ();
+          else
+            {
+              /* Getting here probably means that the content-length was
+               * _less_ than the original, local size. We should probably
+               * truncate or re-read, or something. FIXME */
+              ret = RETROK;
+              goto exit;
+            }
         }
       else /* from now on hstat.res can only be -1 */
         {