Use StreamDataMessage from RNS.Buffer

But don't use Buffer yet
This commit is contained in:
Aaron Heise 2023-03-08 16:54:02 -06:00
parent 5e97dc372e
commit 53332bf1ac
No known key found for this signature in database
GPG key ID: 6BA54088C41DE8BF
2 changed files with 5 additions and 22 deletions

View file

@ -210,7 +210,7 @@ class ListenerSession:
elif not self.channel.is_ready_to_send():
return False
elif len(self.stderr_buf) > 0:
mdu = self.channel.MDU - protocol.StreamDataMessage.OVERHEAD
mdu = protocol.StreamDataMessage.MAX_DATA_LEN
data = self.stderr_buf[:mdu]
self.stderr_buf = self.stderr_buf[mdu:]
send_eof = self.process.stderr_eof and len(data) == 0 and not self.stderr_eof_sent
@ -222,7 +222,7 @@ class ListenerSession:
self.stderr_eof_sent = True
return True
elif len(self.stdout_buf) > 0:
mdu = self.channel.MDU - protocol.StreamDataMessage.OVERHEAD
mdu = protocol.StreamDataMessage.MAX_DATA_LEN
data = self.stdout_buf[:mdu]
self.stdout_buf = self.stdout_buf[mdu:]
send_eof = self.process.stdout_eof and len(data) == 0 and not self.stdout_eof_sent