Fix handling of closed proxy socket

Regression caused by a29946e9. We were no longer detecting a cleanly
closed proxy socket. This is not a WebSocket, but an ordinary one,
so we should be checking for "" rather that None.
This commit is contained in:
Pierre Ossman 2018-01-25 15:46:41 +01:00
parent 46406c76e7
commit 3d20cabf40
1 changed files with 1 additions and 1 deletions

View File

@ -231,7 +231,7 @@ Traffic Legend:
if target in ins:
# Receive target data, encode it and queue for client
buf = target.recv(self.buffer_size)
if buf is None:
if len(buf) == 0:
if self.verbose:
self.log_message("%s:%s: Target closed connection",
self.server.target_host, self.server.target_port)