diff --git a/pupy/network/streams.py b/pupy/network/streams.py index 9a46a59b..c6d0a7e8 100644 --- a/pupy/network/streams.py +++ b/pupy/network/streams.py @@ -31,6 +31,9 @@ class PupySocketStream(SocketStream): self.upstream=Buffer(transport_func=addGetPeer(("127.0.0.1", 443))) self.downstream=Buffer(on_write=self._upstream_recv, transport_func=addGetPeer(sock.getpeername())) + self.upstream_lock=threading.Lock() + self.downstream_lock=threading.Lock() + self.transport=transport_class(self, **transport_kwargs) self.on_connect() #self.async_read_thread=threading.Thread(target=self._downstream_recv_loop) @@ -85,8 +88,9 @@ class PupySocketStream(SocketStream): return self.upstream.read(count) while len(self.upstream)