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 2010/03/18 07:33:00 UTC

Re: svn commit: r924455 - /httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c

On 17.03.2010 21:08, sf@apache.org wrote:
> Author: sf
> Date: Wed Mar 17 20:08:42 2010
> New Revision: 924455
> 
> URL: http://svn.apache.org/viewvc?rev=924455&view=rev
> Log:
> If the client disconnects and the backend continues to send data fast, forcibly
> close the backend connection.
> 
> Modified:
>     httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
> 
> Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c?rev=924455&r1=924454&r2=924455&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c (original)
> +++ httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c Wed Mar 17 20:08:42 2010
> @@ -472,7 +477,10 @@ static int proxy_connect_handler(request
>       * Close the socket and clean up
>       */
>  
> -    ap_lingering_close(backconn);
> +    if (client_error)
> +        apr_socket_close(sock);

Why do we need to close the socket to the client? IMHO this should be done by
the regular mechanism.

Regards

RĂ¼diger


Re: svn commit: r924455 - /httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c

Posted by Ruediger Pluem <rp...@apache.org>.
On 18.03.2010 19:23, Stefan Fritsch wrote:
> On Thursday 18 March 2010, Ruediger Pluem wrote:
>> On 17.03.2010 21:08, sf@apache.org wrote:
>>> Author: sf
>>> Date: Wed Mar 17 20:08:42 2010
>>> New Revision: 924455
>>>
>>> URL: http://svn.apache.org/viewvc?rev=924455&view=rev
>>> Log:
>>> If the client disconnects and the backend continues to send data
>>> fast, forcibly close the backend connection.
>>>
>>> Modified:
>>>     httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
>>>
>>> Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
>>> URL:
>>> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_
>>> proxy_connect.c?rev=924455&r1=924454&r2=924455&view=diff
>>> =================================================================
>>> ============= ---
>>> httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c (original)
>>> +++ httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c Wed Mar
>>> 17 20:08:42 2010 @@ -472,7 +477,10 @@ static int
>>> proxy_connect_handler(request * Close the socket and clean up
>>>       */
>>>
>>> -    ap_lingering_close(backconn);
>>> +    if (client_error)
>>> +        apr_socket_close(sock);
>> Why do we need to close the socket to the client? IMHO this should
>>  be done by the regular mechanism.
> 
> This is not the the socket to the client but the socket to the 
> backend. Probably it would be done by the pool cleanup anyway, but the 
> goal is to avioid a lingering close which would just be a waste of 
> bandwidth. Closing the socket explicitly seemed to be the right thing 
> to do.

Thanks for explaining. I got confused by backconn and socket, but they
are both for the backend (a connection and a socket).

Regards

RĂ¼diger



Re: svn commit: r924455 - /httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Thursday 18 March 2010, Ruediger Pluem wrote:
> On 17.03.2010 21:08, sf@apache.org wrote:
> > Author: sf
> > Date: Wed Mar 17 20:08:42 2010
> > New Revision: 924455
> >
> > URL: http://svn.apache.org/viewvc?rev=924455&view=rev
> > Log:
> > If the client disconnects and the backend continues to send data
> > fast, forcibly close the backend connection.
> >
> > Modified:
> >     httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
> >
> > Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
> > URL:
> > http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_
> >proxy_connect.c?rev=924455&r1=924454&r2=924455&view=diff
> > =================================================================
> >============= ---
> > httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c (original)
> > +++ httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c Wed Mar
> > 17 20:08:42 2010 @@ -472,7 +477,10 @@ static int
> > proxy_connect_handler(request * Close the socket and clean up
> >       */
> >
> > -    ap_lingering_close(backconn);
> > +    if (client_error)
> > +        apr_socket_close(sock);
> 
> Why do we need to close the socket to the client? IMHO this should
>  be done by the regular mechanism.

This is not the the socket to the client but the socket to the 
backend. Probably it would be done by the pool cleanup anyway, but the 
goal is to avioid a lingering close which would just be a waste of 
bandwidth. Closing the socket explicitly seemed to be the right thing 
to do.