Write only when having data.
This commit is contained in:
parent
543d6db55a
commit
af64aae7b6
1 changed files with 4 additions and 2 deletions
|
@ -115,10 +115,12 @@ class ConnHandler(PairedStream):
|
|||
self.remote.read_until_close(callback=self.on_remote_read, streaming_callback=self.on_remote_read)
|
||||
|
||||
def on_client_read(self, data):
|
||||
self.remote.write(crypto.encrypt(data))
|
||||
if data:
|
||||
self.remote.write(crypto.encrypt(data))
|
||||
|
||||
def on_remote_read(self, data):
|
||||
self.write(crypto.decrypt(data))
|
||||
if data:
|
||||
self.write(crypto.decrypt(data))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue