write_to_client: error out on disconnect
authorPeter Zijlstra <peterz@nedstat.com>
Wed, 8 Feb 2006 13:10:53 +0000 (8 14:10 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 29 Apr 2007 13:04:25 +0000 (29 15:04 +0200)
In order to hande the disconnect of web-clients mod_fastcgi needs
not only check the return status of ap_pass_brigade() but also
the connection state.

Otherwise the process manager will glady keep the connection to the
FastCGI process open until it is done generating data.

mod_fastcgi.c

index 05290e1..7f236d3 100644 (file)
@@ -933,8 +933,7 @@ static int write_to_client(fcgi_request *fr)
 
 #endif
 
-    if (rv)
-    {
+    if (rv || fr->r->connection->aborted) {
         ap_log_rerror(FCGI_LOG_INFO_NOERRNO, fr->r,
             "FastCGI: client stopped connection before send body completed");
         return -1;