You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ruediger Pluem <rp...@apache.org> on 2006/02/07 22:03:17 UTC

Connection: close forwarded to backend by proxy code

In PR 38524 it is noted that a Connection: close send by the client
also closes the connection to the backend server.

Actually this is caused by the following code in mod_proxy_http.c

    /* strip connection listed hop-by-hop headers from the request */
    /* even though in theory a connection: close coming from the client
     * should not affect the connection to the server, it's unlikely
     * that subsequent client requests will hit this thread/process,
     * so we cancel server keepalive if the client does.
     */
    if (ap_proxy_liststr(apr_table_get(r->headers_in,
                         "Connection"), "close")) {
        p_conn->close++;

Currently I am undecided if this behaviour is a needed feature or if
it is a relict from the 2.0 proxy architecture where the arguments in the comment
seem to be more appropriate.
So advice is much appreciated :-).

Regards

RĂ¼diger


Re: Connection: close forwarded to backend by proxy code

Posted by Graham Leggett <mi...@sharp.fm>.
Ruediger Pluem wrote:

> In PR 38524 it is noted that a Connection: close send by the client
> also closes the connection to the backend server.
> 
> Actually this is caused by the following code in mod_proxy_http.c
> 
>     /* strip connection listed hop-by-hop headers from the request */
>     /* even though in theory a connection: close coming from the client
>      * should not affect the connection to the server, it's unlikely
>      * that subsequent client requests will hit this thread/process,
>      * so we cancel server keepalive if the client does.
>      */
>     if (ap_proxy_liststr(apr_table_get(r->headers_in,
>                          "Connection"), "close")) {
>         p_conn->close++;
> 
> Currently I am undecided if this behaviour is a needed feature or if
> it is a relict from the 2.0 proxy architecture where the arguments in the comment
> seem to be more appropriate.
> So advice is much appreciated :-).

I'd say it's a relic from the old architecture - the connection pool 
won't work if the backend keeps closing its connections.

Regards,
Graham
--