diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-01-07 14:57:18 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-01-07 14:57:18 +0000 |
commit | e31a306a38c7430950a3535f7a91f25cb5a018a1 (patch) | |
tree | 8909ec91f4057aa2938451aec3f0bb21bd1bbc80 | |
parent | d9a77730114b25f0d073208495c8702d9dc28161 (diff) |
HTTP response 204 should be treated similar to 304, that is we must not
expect (nor read) any response-body
-rw-r--r-- | lib/transfer.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 159151f59..a47fa1c57 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -424,14 +424,22 @@ CURLcode Curl_readwrite(struct connectdata *conn, server keeps it open for us! */ conn->bits.close = TRUE; - if (k->httpcode == 304) - /* (quote from RFC2616, section 10.3.5): - * The 304 response MUST NOT contain a - * message-body, and thus is always - * terminated by the first empty line - * after the header fields. - */ + switch(k->httpcode) { + case 204: + /* (quote from RFC2616, section 10.2.5): The server has + * fulfilled the request but does not need to return an + * entity-body ... The 204 response MUST NOT include a + * message-body, and thus is always terminated by the first + * empty line after the header fields. */ + /* FALLTHROUGH */ + case 304: + /* (quote from RFC2616, section 10.3.5): The 304 response MUST + * NOT contain a message-body, and thus is always terminated + * by the first empty line after the header fields. */ conn->size=0; + default: + /* nothing */ + } } else { k->header = FALSE; /* this is not a header line */ |