+2014-04-22 Tim Ruehsen <tim.ruehsen@gmx.de>
+
+ * http.c (gethttp): Fix 204 response handling
+
2014-03-26 Darshit Shah <darnir@gmail.com>
* ftp.c (getftp): Rearrange parameters to fix compiler warning
if (H_20X (statcode))
*dt |= RETROKF;
+ if (statcode == HTTP_STATUS_NO_CONTENT)
+ {
+ /* 204 response has no body (RFC 2616, 4.3) */
+
+ /* In case the caller cares to look... */
+ hs->len = 0;
+ hs->res = 0;
+ hs->restval = 0;
+
+ CLOSE_FINISH (sock);
+ xfree_null (type);
+ xfree (head);
+
+ return RETRFINISHED;
+ }
+
/* Return if redirected. */
if (H_REDIRECTED (statcode) || statcode == HTTP_STATUS_MULTIPLE_CHOICES)
{
+2014-40-22 Tim Ruehsen <tim.ruehsen@gmx.de>
+
+ * Test-204.px: added file
+ * run-px: added Test-204.px
+ * Makefile.am: added Test-204.px
+
2014-04-22 Giuseppe Scrivano <gscrivan@redhat.com>
* Makefile.am (EXTRA_DIST): Add missing Test--start-pos.px,
Test--start-pos.px \
Test--start-pos--continue.px \
Test--httpsonly-r.px \
+ Test-204.px \
run-px certs
check_PROGRAMS = unit-tests
--- /dev/null
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use HTTPTest;
+
+
+###############################################################################
+
+# code, msg, headers, content
+my %urls = (
+ '/dummy' => {
+ code => "204",
+ msg => "Dontcare",
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " http://localhost:{{port}}/dummy";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-204",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
'Test--start-pos.px',
'Test-ftp--start-pos.px',
'Test--start-pos--continue.px',
+ 'Test-204.px',
);
foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {