Dolda2000 GitWeb
/
ashd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
python: Rethrow special IOErrors when a client has aborted.
[ashd.git]
/
python
/
ashd
/
scgi.py
diff --git
a/python/ashd/scgi.py
b/python/ashd/scgi.py
index
a4342d0
..
0bc7a57
100644
(file)
--- a/
python/ashd/scgi.py
+++ b/
python/ashd/scgi.py
@@
-4,6
+4,10
@@
import threading
class protoerr(Exception):
pass
class protoerr(Exception):
pass
+class closed(IOError):
+ def __init__(self):
+ super(closed, self).__init__("The client has closed the connection.")
+
def readns(sk):
hln = 0
while True:
def readns(sk):
hln = 0
while True:
@@
-88,9
+92,12
@@
def wrapwsgi(handler):
def write(data):
if not data:
return
def write(data):
if not data:
return
- flushreq()
- sk.write(data)
- sk.flush()
+ try:
+ flushreq()
+ sk.write(data)
+ sk.flush()
+ except IOError:
+ raise closed()
def startreq(status, headers, exc_info = None):
if resp:
def startreq(status, headers, exc_info = None):
if resp: