You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Bryan Call (JIRA)" <ji...@apache.org> on 2013/12/06 00:12:35 UTC

[jira] [Assigned] (TS-2419) Don't close client connection when responding with a 204 and there is no body

     [ https://issues.apache.org/jira/browse/TS-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Call reassigned TS-2419:
------------------------------

    Assignee: Bryan Call

> 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#6144)