class reqthread(threading.Thread):
def __init__(self, sk, handler):
super(reqthread, self).__init__(name = "SCGI request handler")
- self.sk = sk.dup().makefile("r+")
+ self.bsk = sk.dup()
+ self.sk = self.bsk.makefile("r+")
self.handler = handler
def run(self):
self.handler(head, self.sk)
finally:
self.sk.close()
+ self.bsk.close()
def handlescgi(sk, handler):
t = reqthread(sk, handler)
class reqthread(threading.Thread):
def __init__(self, sk, handler):
super(reqthread, self).__init__(name = "SCGI request handler")
- self.sk = sk.dup().makefile("rwb")
+ self.bsk = sk.dup()
+ self.sk = self.bsk.makefile("rwb")
self.handler = handler
def run(self):
self.handler(head, self.sk)
finally:
self.sk.close()
+ self.bsk.close()
def handlescgi(sk, handler):
t = reqthread(sk, handler)