]> sjero.net Git - wget/commitdiff
[svn] Respect --ignore-length.
authorhniksic <devnull@localhost>
Sat, 7 Feb 2004 01:48:54 +0000 (17:48 -0800)
committerhniksic <devnull@localhost>
Sat, 7 Feb 2004 01:48:54 +0000 (17:48 -0800)
Inhibit keep-alive when --ignore-length is used.

src/ChangeLog
src/http.c

index d40523b9ef53005b896875e49f6f28360f2b4a4f..03858dc835d60fdc7f5b6bfdcc7652e94893a559 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-06  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * http.c (gethttp): Respect --ignore-length.
+       (gethttp): Inhibit keep-alive if --ignore-length is specified.
+
 2004-02-06  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * connect.c (sockaddr_set_data): Zero out
index b779e36ee6f71d82318c8e5ba7e9780bcbbbf5c5..86324f08c878a53c885c40bcda6bd80475660e4d 100644 (file)
@@ -1057,7 +1057,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
   int keep_alive;
 
   /* Whether keep-alive should be inhibited. */
-  int inhibit_keep_alive = !opt.http_keep_alive;
+  int inhibit_keep_alive = !opt.http_keep_alive || opt.ignore_length;
 
   /* Headers sent when using POST. */
   long post_data_size = 0;
@@ -1455,7 +1455,8 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
       print_server_response (resp, "  ");
     }
 
-  if (response_header_copy (resp, "Content-Length", hdrval, sizeof (hdrval)))
+  if (!opt.ignore_length
+      && response_header_copy (resp, "Content-Length", hdrval, sizeof (hdrval)))
     contlen = strtol (hdrval, NULL, 10);
 
   /* Check for keep-alive related responses. */