Fix bugs
This commit is contained in:
parent
d3e6989dcd
commit
c06c93d723
1 changed files with 3 additions and 2 deletions
|
@ -115,13 +115,14 @@ class ConnHandler(PairedStream):
|
|||
def on_remote_connected(self):
|
||||
self.read_until_close(callback=self.on_client_read, streaming_callback=self.on_client_read)
|
||||
self.remote.read_until_close(callback=self.on_remote_read, streaming_callback=self.on_remote_read)
|
||||
self._read_from_buffer() # We must call this to empty filled buffer otherwise nothing will be read in again.
|
||||
|
||||
def on_client_read(self, data):
|
||||
if data:
|
||||
if data and not self.remote.closed():
|
||||
self.remote.write(crypto.decrypt(data))
|
||||
|
||||
def on_remote_read(self, data):
|
||||
if data:
|
||||
if data and not self.closed():
|
||||
self.write(crypto.encrypt(data))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue