Bug 32443 - mod_proxy will keep alive to streaming server after user shutdown connection
Summary: mod_proxy will keep alive to streaming server after user shutdown connection
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 2.0.52
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
: 29644 39442 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-30 09:09 UTC by tao
Modified: 2006-05-09 07:15 UTC (History)
2 users (show)



Attachments
backported patch (1.20 KB, patch)
2005-01-19 12:13 UTC, Joe Orton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tao 2004-11-30 09:09:21 UTC
I am try to use mod_proxy to proxy a Windows Media stream on HTTP protocol 
that generate by Windows Media Service.
This is a typical Keep-alive stream. I use Windows Media Player as the client
and mod_proxy on Apache2.0.52 get stream data from remote stream server, and 
pass it to player via HTTP also. It works very well.
But when I shutdown the media player, the mod_proxy still connect to the 
remote stream server, and retrive data as before.
And, the error.log grows at at a about 18KB/s speed. 
All the error like:
XXXXXXXX info (OS 10053)xxxxxxxxxxxxxxxxx  core_output_filter: writing data to 
the network

It seems that mod_proxy does not know the client is shutdown and still try to 
feed data to client.

And, as new access entered, the mod_proxy will open a new session to stream 
server, and after user shutdown, the connection to stream server is still 
alive. After servral times, I have to stop the Apache.
Comment 1 tao 2004-11-30 09:12:20 UTC
> And, the error.log grows at at a about 18KB/s speed. 
Sorry, it should be 18KB/min.

(In reply to comment #0)
Comment 2 Janne Hietam 2005-01-10 17:10:46 UTC
I had the same problem and I did some debugging.

This happends because ap_pass_brigade returns always APR_SUCCESS on
ap_proxy_http_process_response (from server/core.c).

here is a quick patch for this:

change line
                    if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS) {

on file modules/proxy/proxy_http.c to:

                    if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS ||
c->aborted) {


Comment 3 Janne Hietam 2005-01-10 17:13:14 UTC
*** Bug 29644 has been marked as a duplicate of this bug. ***
Comment 4 Joe Orton 2005-01-19 12:11:16 UTC
Thanks for the patch.  I added the same logic in two other places where it was
also needed and committed that.

http://svn.apache.org/viewcvs?view=rev&rev=125612 [viewsvn currently disabled]
Comment 5 Joe Orton 2005-01-19 12:13:23 UTC
Created attachment 14046 [details]
backported patch

backported version of patch for submission to 2.0
Comment 6 Joe Orton 2006-05-09 14:15:37 UTC
*** Bug 39442 has been marked as a duplicate of this bug. ***