]> sjero.net Git - wget/blobdiff - src/http.c
Don't abort when len > contlen, when we set it that way.
[wget] / src / http.c
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 */
         {