1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Fix broken --save-headers.

This commit is contained in:
hniksic 2005-06-18 07:13:16 -07:00
parent 1805044ecd
commit 613719687c
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-06-18 Hrvoje Niksic <hniksic@xemacs.org>
* http.c (gethttp): Don't free "head" before using it to save
headers.
2005-06-18 Hrvoje Niksic <hniksic@xemacs.org> 2005-06-18 Hrvoje Niksic <hniksic@xemacs.org>
* http.c (gethttp): When -E is in use, check for file existence * http.c (gethttp): When -E is in use, check for file existence

View File

@ -1753,7 +1753,6 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
contrange = first_byte_pos; contrange = first_byte_pos;
} }
resp_free (resp); resp_free (resp);
xfree (head);
/* 20x responses are counted among successful by default. */ /* 20x responses are counted among successful by default. */
if (H_20X (statcode)) if (H_20X (statcode))
@ -1946,6 +1945,9 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
if (opt.save_headers) if (opt.save_headers)
fwrite (head, 1, strlen (head), fp); fwrite (head, 1, strlen (head), fp);
/* Now we no longer need to store the response header. */
xfree (head);
/* Download the request body. */ /* Download the request body. */
flags = 0; flags = 0;
if (keep_alive) if (keep_alive)