[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] [PATCH] wget hangs on HTTP 204
From: |
Giuseppe Scrivano |
Subject: |
Re: [Bug-wget] [PATCH] wget hangs on HTTP 204 |
Date: |
Tue, 22 Apr 2014 18:08:08 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Tim Ruehsen <address@hidden> writes:
> Attached is a patch including a new test case.
>
> Guiseppe, I made it for a clone of Darshit's clone of Wget. Not sure if it
> fits into master.
thanks for your patch. It applies to master.
Do you mind if I amend this change in the patch before pushing it
(shouldn't break anything)? :-)
Giuseppe
diff --git a/src/http.c b/src/http.c
index bc5e996..00a35b3 100644
--- a/src/http.c
+++ b/src/http.c
@@ -2614,10 +2614,13 @@ read_header:
}
resp_free (resp);
+ /* 20x responses are counted among successful by default. */
+ if (H_20X (statcode))
+ *dt |= RETROKF;
+
if (statcode == HTTP_STATUS_NO_CONTENT)
{
/* 204 response has no body (RFC 2616, 4.3) */
- *dt |= RETROKF;
/* In case the caller cares to look... */
hs->len = 0;
@@ -2631,10 +2634,6 @@ read_header:
return RETRFINISHED;
}
- /* 20x responses are counted among successful by default. */
- if (H_20X (statcode))
- *dt |= RETROKF;
-
/* Return if redirected. */
if (H_REDIRECTED (statcode) || statcode == HTTP_STATUS_MULTIPLE_CHOICES)
{