summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Saddi <allan@saddi.com>2007-05-11 16:52:04 +0000
committerAllan Saddi <allan@saddi.com>2007-05-11 16:52:04 +0000
commitb16eb34a602b758f46194cc91db1dd15b06d239f (patch)
tree8228400d25339503af4dc7662719d8af82e7252c
parent2cab464ff40b42cf6798b2f8f4a7bf65e808aa66 (diff)
downloadflup-b16eb34a602b758f46194cc91db1dd15b06d239f.tar.gz
Catch and ignore EPIPE when flushing the streams and ending the request.
-rw-r--r--flup/server/fcgi_base.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/flup/server/fcgi_base.py b/flup/server/fcgi_base.py
index 15f59c9..42ab282 100644
--- a/flup/server/fcgi_base.py
+++ b/flup/server/fcgi_base.py
@@ -567,8 +567,12 @@ class Request(object):
if __debug__: _debug(1, 'protocolStatus = %d, appStatus = %d' %
(protocolStatus, appStatus))
- self._flush()
- self._end(appStatus, protocolStatus)
+ try:
+ self._flush()
+ self._end(appStatus, protocolStatus)
+ except socket.error, e:
+ if e[0] != errno.EPIPE:
+ raise
def _end(self, appStatus=0L, protocolStatus=FCGI_REQUEST_COMPLETE):
self._conn.end_request(self, appStatus, protocolStatus)