From: Alex Graveley Date: Mon, 30 Jul 2001 22:58:29 +0000 (+0000) Subject: Content-length should be avoided for HEAD requests. X-Git-Tag: SOUP_0_4~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6115acf63c5588150fed435b80c8f7cbffe9e8cd;p=platform%2Fupstream%2Flibsoup.git Content-length should be avoided for HEAD requests. 2001-07-30 Alex Graveley * src/soup-core/soup-queue.c (soup_queue_read_headers_cb): Content-length should be avoided for HEAD requests. --- diff --git a/ChangeLog b/ChangeLog index df250db..52f4d32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2001-07-30 Alex Graveley + * src/soup-core/soup-queue.c (soup_queue_read_headers_cb): + Content-length should be avoided for HEAD requests. + +2001-07-30 Alex Graveley + * src/soup-core/soup-misc.c (soup_load_config_internal): Fix bug where only the first valid config token is loaded from the config file. diff --git a/libsoup/soup-queue.c b/libsoup/soup-queue.c index 6bb4d0c..3214a63 100644 --- a/libsoup/soup-queue.c +++ b/libsoup/soup-queue.c @@ -85,10 +85,13 @@ soup_queue_read_headers_cb (const GString *headers, if (connection && g_strcasecmp (connection, "close") == 0) soup_connection_set_keep_alive (req->priv->conn, FALSE); + if (!g_strcasecmp (req->method, "HEAD")) + goto RUN_HANDLERS; + /* Handle Content-Length or Chunked encoding */ length = g_hash_table_lookup (req->response_headers, "Content-Length"); enc = g_hash_table_lookup (req->response_headers, "Transfer-Encoding"); - + if (length) { *content_len = atoi (length); if (*content_len < 0) @@ -102,6 +105,7 @@ soup_queue_read_headers_cb (const GString *headers, } } + RUN_HANDLERS: err = soup_message_run_handlers (req, SOUP_HANDLER_PRE_BODY); if (err) goto THROW_MALFORMED_HEADER; if (req->status == SOUP_STATUS_QUEUED) return FALSE;