[ 
https://issues.apache.org/jira/browse/TS-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13878843#comment-13878843
 ] 

William Bardwell commented on TS-2419:
--------------------------------------

Note: I tried to back port this to 3.2.4 and I am seeing crashes where 
s->current.server can be NULL during that new check for transfer encoding.  Not 
sure if the same thing can happen in 4.X, but maybe...

> Don't close client connection when responding with a 204 and there is no body
> -----------------------------------------------------------------------------
>
>                 Key: TS-2419
>                 URL: https://issues.apache.org/jira/browse/TS-2419
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: HTTP
>            Reporter: Bryan Call
>            Assignee: Bryan Call
>             Fix For: 4.2.0
>
>
> Currently ATS closes the client connection when returning a 204.  In 
> production I saw a 2x the number of requests per connection when not closing 
> the connection on a 204 response.  It the patch below I only close the 
> connection if it is chunked encoding or content length not equal to 0.
> patch so far, untested:
> {code}
> diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
> index 049e672..ad3bbfd 100644
> --- a/proxy/http/HttpTransact.cc
> +++ b/proxy/http/HttpTransact.cc
> @@ -6756,9 +6756,10 @@ 
> HttpTransact::handle_response_keep_alive_headers(State* s, HTTPVersion ver, 
> HTTP
>    } else if (HTTP_MAJOR(ver.m_version) == 0) {  /* No K-A for 0.9 apps */
>      ka_action = KA_DISABLED;
>    }
> -  // some systems hang until the connection closes when receiving a 204
> -  //   regardless of the K-A headers
> -  else if (heads->status_get() == HTTP_STATUS_NO_CONTENT) {
> +  else if (heads->status_get() == HTTP_STATUS_NO_CONTENT &&
> +      (s->current.server->transfer_encoding != NO_TRANSFER_ENCODING || 
> s->hdr_info.request_content_length != 0)) {
> +    // some systems hang until the connection closes when receiving a 204 
> regardless of the K-A headers
> +    // close if there is any body response from the origin
>      ka_action = KA_CLOSE;
>    } else {
>      // Determine if we are going to send either a server-generated or
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to