Do not hang on non-ready client connection.

Wait 3 seconds for the client to send something. If no data is
available within 3 seconds then close the connection. It's probably
a non-WebSockets client that is waiting for the server to say
something first.
This commit is contained in:
Joel Martin
2011-01-13 12:22:22 -06:00
parent 046e22ea00
commit 9c4cf4ada2
2 changed files with 9 additions and 2 deletions
+4 -1
View File
@@ -160,7 +160,10 @@ Traffic Legend:
try:
self.do_proxy(client, tsock)
except:
if tsock: tsock.close()
if tsock:
tsock.close()
self.vmsg("%s:%s: Target closed" %(
self.target_host, self.target_port))
if self.rec:
self.rec.write("'EOF']\n")
self.rec.close()