X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fhttp.c;fp=src%2Fhttp.c;h=00a35b324aae5ed9672d6a91c4e6bb6d42ecbaf6;hp=8bba70dfdb5cb0ea0fa192c01361559e18e81af4;hb=848d7537e17a6ca6b5e91b016e1490b1703b7331;hpb=6c572cbc332e138130fac8309fc123c44ee53e80 diff --git a/src/http.c b/src/http.c index 8bba70df..00a35b32 100644 --- a/src/http.c +++ b/src/http.c @@ -2618,6 +2618,22 @@ read_header: 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) {