From b16eb34a602b758f46194cc91db1dd15b06d239f Mon Sep 17 00:00:00 2001 From: Allan Saddi Date: Fri, 11 May 2007 16:52:04 +0000 Subject: Catch and ignore EPIPE when flushing the streams and ending the request. --- flup/server/fcgi_base.py | 8 ++++++-- 1 file 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) -- cgit v1.2.1