trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Peach <jpe...@apache.org>
Subject Re: trafficserver git commit: [TS-3199]: Do not wait for body for HEAD method
Date Sat, 15 Nov 2014 00:33:52 GMT

> On Nov 14, 2014, at 4:27 PM, sudheerv@apache.org wrote:
> 
> Repository: trafficserver
> Updated Branches:
>  refs/heads/master 5c37860c7 -> d26674750
> 
> 
> [TS-3199]: Do not wait for body for HEAD method
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d2667475
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d2667475
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d2667475
> 
> Branch: refs/heads/master
> Commit: d26674750e10c89029d752e86de4dc6ef5bf3588
> Parents: 5c37860
> Author: Sudheer Vinukonda <sudheerv@yahoo-inc.com>
> Authored: Sat Nov 15 00:26:16 2014 +0000
> Committer: Sudheer Vinukonda <sudheerv@yahoo-inc.com>
> Committed: Sat Nov 15 00:26:16 2014 +0000
> 
> ----------------------------------------------------------------------
> proxy/FetchSM.cc                | 9 ++++++++-
> proxy/FetchSM.h                 | 4 ++--
> proxy/spdy/SpdyClientSession.cc | 7 ++-----
> 3 files changed, 12 insertions(+), 8 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d2667475/proxy/FetchSM.cc
> ----------------------------------------------------------------------
> diff --git a/proxy/FetchSM.cc b/proxy/FetchSM.cc
> index 91d1111..ad7e655 100644
> --- a/proxy/FetchSM.cc
> +++ b/proxy/FetchSM.cc
> @@ -105,6 +105,8 @@ FetchSM::has_body()
>   if (!header_done)
>     return false;
> 
> +  if (is_method_head)
> +    return false;
>   //
>   // The following code comply with HTTP/1.1:
>   // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4
> @@ -550,12 +552,17 @@ FetchSM::ext_init(Continuation *cont, const char *method,
>   memset(&callback_options, 0, sizeof(callback_options));
>   memset(&callback_events, 0, sizeof(callback_events));
> 
> -  req_buffer->write(method, strlen(method));
> +  int method_len = strlen(method);
> +  req_buffer->write(method, method_len);
>   req_buffer->write(" ", 1);
>   req_buffer->write(url, strlen(url));
>   req_buffer->write(" ", 1);
>   req_buffer->write(version, strlen(version));
>   req_buffer->write("\r\n", 2);
> +
> +  if ((method_len == strlen("HEAD")) && !memcmp(method, "HEAD", method_len))
{

Shouldn't this be:

    if ((method_len == HTTP_LEN_HEAD) && (memcmp(method, HTTP_METHOD_HEAD, method_len)
== 0))

J
Mime
View raw message