mod_proxy fails to shutdown when client cancels

"Noel Burton-Krahn" <[email protected]>
Newsgroups gmane.comp.apache.mod-proxy
Message-ID <017501c259e4$46afd820$8600000a@noel>
I have Apache-1.3.26 proxying requests to another back-end http server.  If
the client cancels a connection while sending the parameters, the proxied
server does not see the connection close, and it hangs.

1. start a long file upload request
2. apache opens a new connection to the back-end
3. client cancells upload
4. the connection to apache closes
5. apache blocks reading the request from the back-end
6. since apche doesn't call shutdown()  on the socket connected to the
back-end, the back-end server doesn't know the client broke the connection
and hangs waiting for more input.

See modules/proxy_http.c line 426.  I think there should something like this
should be inserted on line 433:

    if( i<=0) {
        shutdown(1);
    }

What do you think?


In the bigger scheme of things, its a bad idea for a proxy server to buffer
a whole request before reading the reply.  Could mod_proxy be redone to pipe
both sides at once?

--Noel Burton-Krahn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.