You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2013/01/23 15:01:08 UTC

[Bug 54474] New: mod_proxy_connect keeps open connection to client

https://issues.apache.org/bugzilla/show_bug.cgi?id=54474

            Bug ID: 54474
           Summary: mod_proxy_connect keeps open connection to client
           Product: Apache httpd-2
           Version: 2.4.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: mod_proxy_connect
          Assignee: bugs@httpd.apache.org
          Reporter: pavel@netsafe.cz
    Classification: Unclassified

RFC 2817 section 5.3 Establishing a Tunnel with CONNECT says:
"If at any point either one of the peers gets disconnected, any
outstanding data that came from that peer will be passed to the other
one, and after that also the other connection will be terminated by
the proxy."
Which is not what apache 2.4 does.

After upgrade from apache 2.2.23 to 2.4.3 I've encountered problem loading page
without Content-Length from HTTPS backend thru proxy.
Backend server sends webpage and closes connection just fine. Proxy keeps
connection to client open and eventually closes it after few seconds with
message "AH01382: Request header read timeout".

Strange thing is that all requests were fine in 2.2.23 and requests with
defined Content-Length are fine in 2.4.3 too.

I was able to make naive workaround which is probably completelly wrong:

--- httpd-2.4.3/modules/proxy/mod_proxy_connect.c  2012-07-28
16:40:23.000000000 +0200
+++ httpd-2.4.3-fixed/modules/proxy/mod_proxy_connect.c   2013-01-23
14:38:10.000000000 +0100
@@ -481,6 +481,8 @@
      * Close the socket and clean up
      */

+    apr_socket_close(client_socket);
+
     if (client_error)
         apr_socket_close(sock);
     else

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 54474] mod_proxy_connect keeps open connection to client

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54474

--- Comment #1 from Pavel Mateja <pa...@netsafe.cz> ---
Oh, to make it more weird:
The problem was seen with wget. LWP was able to fetch the page without waiting
to timeout.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 54474] mod_proxy_connect keeps open connection to client

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54474

--- Comment #2 from Eric Covener <co...@gmail.com> ---
(In reply to comment #1)
> Oh, to make it more weird:
> The problem was seen with wget. LWP was able to fetch the page without
> waiting to timeout.

maybe one sends asks for connection-close or http/1.0 and not the other?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 54474] mod_proxy_connect keeps open connection to client

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54474

Stefan Fritsch <sf...@sfritsch.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |FixedInTrunk

--- Comment #5 from Stefan Fritsch <sf...@sfritsch.de> ---
mod_proxy_connect has significant changes compared to 2.2, to make it work
through https. So it's not really surprising that it behaves differently than
in 2.2. 

Thanks for the debugging.
committed to trunk: r1442320
proposed for 2.4

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 54474] mod_proxy_connect keeps open connection to client

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54474

--- Comment #4 from Pavel Mateja <pa...@netsafe.cz> ---
Created attachment 29917
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29917&action=edit
Disable Keep-alive for CONNECT

RFC2817
5.3 Establishing a Tunnel with CONNECT
...
If at any point either one of the peers gets disconnected, any
outstanding data that came from that peer will be passed to the other
one, and after that also the other connection will be terminated by
the proxy. If there is outstanding data to that peer undelivered,
that data will be discarded.

This means we can't keep connection alive after CONNECT method.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 54474] mod_proxy_connect keeps open connection to client

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54474

Stefan Fritsch <sf...@sfritsch.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Stefan Fritsch <sf...@sfritsch.de> ---
fixed in 2.4.4

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 54474] mod_proxy_connect keeps open connection to client

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54474

--- Comment #3 from Pavel Mateja <pa...@netsafe.cz> ---
debug (In reply to comment #2)
> (In reply to comment #1)
> > Oh, to make it more weird:
> > The problem was seen with wget. LWP was able to fetch the page without
> > waiting to timeout.
> 
> maybe one sends asks for connection-close or http/1.0 and not the other?

Checked. LWP sends just GET, not CONNECT.

But it doesn't matter really. Apache 2.2 was able to close the client
connection when backend closed it's side.
Do you know where exactly is the code supposed to do it?

And I realized this are two bugs in one report.
1) open connection.
2) CONNECT is guarded by RequestReadTimeout from mod_reqtimeout instead of
general Timeout.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org