Hallo Joshua, thanks for reporting (and don't mind about duplicates). It is an old problem that pops up again and again...
RFC 2616 4.3: All 1xx (informational), 204 (no content), and 304 (not modified) responses MUST NOT include a message-body. All other responses do include a message-body, although it MAY be of zero length. We need to extend the test suite to include such a check. And Joshua is right - Wget should not create a file at all in this case. Tim On Monday 21 April 2014 10:57:46 Joshua Pawlicki wrote: > RFC 2616: "The 204 response MUST NOT include a message-body, and thus is > always terminated by the first empty line after the header fields." > > So I would expect wget to terminate the connection immediately and write no > file (or an empty file) when receiving a 204 response. However, it appears > to attempt to keep the connection open and download a file that is not > coming. > > I hope this isn't a duplicate - I couldn't find a post in about 204 in the > archives, but it seems to be a widely known problem ( > https://www.google.com/search?q=wget+204 ). > > To reproduce: > `wget --server-response http://cr-tools.clients.google.com/service/check2` > > bin$ ./wget --server-response > http://cr-tools.clients.google.com/service/check2 > --2014-04-21 10:55:36-- http://cr-tools.clients.google.com/service/check2 > Resolving cr-tools.clients.google.com (cr-tools.clients.google.com)... > 2607:f8b0:400a:804::1009, 173.194.33.168, 173.194.33.169, ... > Connecting to cr-tools.clients.google.com > (cr-tools.clients.google.com)|2607:f8b0:400a:804::1009|:80... > connected. > HTTP request sent, awaiting response... > HTTP/1.1 204 No Content > X-Google-Netmon-Label: > /bns/pa/borg/pa/bns/download/download-aus.autoupdateserver/79 > Location: > Date: Mon, 21 Apr 2014 17:55:36 GMT > Server: GSE > X-Google-ServerType: tbhome > X-Google-Backends: > /bns/pa/borg/pa/bns/download/download-aus.autoupdateserver/79,achq7:80 > X-Google-GFE-Request-Trace: > achq7:80,/bns/pa/borg/pa/bns/download/download-aus.autoupdateserver/79,achq7 > :80 X-Google-DOS-Service-Trace: main:tbhome > X-Google-Service: tbhome > X-Google-GFE-Response-Code-Details-Trace: response_code_set_by_backend > X-Google-Shellfish-Status: CIgC > Alternate-Protocol: 80:quic > X-Google-GFE-Service-Trace: tbhome > Length: unspecified > Saving to: ‘check2.2’ > > [ <=> > ] 0 > --.-K/s ^C > bin$ ./wget --version > GNU Wget 1.15 built on linux-gnu. > > +digest +https +ipv6 +iri +large-file +nls -ntlm +opie +ssl/gnutls > > Wgetrc: > /usr/local/google/home/waffles/bin/wget/etc/wgetrc (system) > Locale: > /usr/local/google/home/waffles/bin/wget/share/locale > Compile: > gcc -DHAVE_CONFIG_H > -DSYSTEM_WGETRC="/usr/local/google/home/waffles/bin/wget/etc/wgetrc" > -DLOCALEDIR="/usr/local/google/home/waffles/bin/wget/share/locale" > -I. -I../lib -I../lib -O2 -Wall > Link: > gcc -O2 -Wall -lgnutls -lz -lidn -lpcre -lrt ftp-opie.o gnutls.o > ../lib/libgnu.a > > Copyright (C) 2011 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > <http://www.gnu.org/licenses/gpl.html>. > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. > > Originally written by Hrvoje Niksic <[email protected]>. > Please send bug reports and questions to <[email protected]>.
