mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Correctly skip error message body for keep-alive connections.
This commit is contained in:
parent
09473867ea
commit
025fcc29a8
@ -1,3 +1,8 @@
|
||||
2005-07-02 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* http.c (gethttp): Except for head_only, use skip_short_body to
|
||||
skip the non-20x error message before leaving gethttp.
|
||||
|
||||
2005-07-02 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* url.c (url_parse): Would crash when parsing fragments. Support
|
||||
|
16
src/http.c
16
src/http.c
@ -1884,11 +1884,17 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
|
||||
hs->len = 0;
|
||||
hs->res = 0;
|
||||
xfree_null (type);
|
||||
/* Pre-1.10 Wget used CLOSE_INVALIDATE here. Now we trust the
|
||||
servers not to send body in response to a HEAD request. If
|
||||
you encounter such a server (more likely a broken CGI), use
|
||||
`--no-http-keep-alive'. */
|
||||
CLOSE_FINISH (sock);
|
||||
if (head_only)
|
||||
/* Pre-1.10 Wget used CLOSE_INVALIDATE here. Now we trust the
|
||||
servers not to send body in response to a HEAD request. If
|
||||
you encounter such a server (more likely a broken CGI), use
|
||||
`--no-http-keep-alive'. */
|
||||
CLOSE_FINISH (sock);
|
||||
else if (keep_alive && skip_short_body (sock, contlen))
|
||||
/* Successfully skipped the body; also keep using the socket. */
|
||||
CLOSE_FINISH (sock);
|
||||
else
|
||||
CLOSE_INVALIDATE (sock);
|
||||
return RETRFINISHED;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user