mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-04-21 09:48:51 +02:00
Fix warning: closed channel got=STOP_SENDING
This commit is contained in:
parent
fbbcc05d58
commit
fee5868196
@ -503,17 +503,25 @@ class MuxWrapper(SockWrapper):
|
|||||||
return 'SW%r:Mux#%d' % (self.peername, self.channel)
|
return 'SW%r:Mux#%d' % (self.peername, self.channel)
|
||||||
|
|
||||||
def noread(self):
|
def noread(self):
|
||||||
|
if not self.shut_read:
|
||||||
|
self.mux.send(self.channel, CMD_TCP_STOP_SENDING, b(''))
|
||||||
|
self.setnoread()
|
||||||
|
|
||||||
|
def setnoread(self):
|
||||||
if not self.shut_read:
|
if not self.shut_read:
|
||||||
debug2('%r: done reading\n' % self)
|
debug2('%r: done reading\n' % self)
|
||||||
self.shut_read = True
|
self.shut_read = True
|
||||||
self.mux.send(self.channel, CMD_TCP_STOP_SENDING, b(''))
|
|
||||||
self.maybe_close()
|
self.maybe_close()
|
||||||
|
|
||||||
def nowrite(self):
|
def nowrite(self):
|
||||||
|
if not self.shut_write:
|
||||||
|
self.mux.send(self.channel, CMD_TCP_EOF, b(''))
|
||||||
|
self.setnowrite()
|
||||||
|
|
||||||
|
def setnowrite(self):
|
||||||
if not self.shut_write:
|
if not self.shut_write:
|
||||||
debug2('%r: done writing\n' % self)
|
debug2('%r: done writing\n' % self)
|
||||||
self.shut_write = True
|
self.shut_write = True
|
||||||
self.mux.send(self.channel, CMD_TCP_EOF, b(''))
|
|
||||||
self.maybe_close()
|
self.maybe_close()
|
||||||
|
|
||||||
def maybe_close(self):
|
def maybe_close(self):
|
||||||
@ -542,9 +550,11 @@ class MuxWrapper(SockWrapper):
|
|||||||
|
|
||||||
def got_packet(self, cmd, data):
|
def got_packet(self, cmd, data):
|
||||||
if cmd == CMD_TCP_EOF:
|
if cmd == CMD_TCP_EOF:
|
||||||
self.noread()
|
# Remote side already knows the status - set flag but don't notify
|
||||||
|
self.setnoread()
|
||||||
elif cmd == CMD_TCP_STOP_SENDING:
|
elif cmd == CMD_TCP_STOP_SENDING:
|
||||||
self.nowrite()
|
# Remote side already knows the status - set flag but don't notify
|
||||||
|
self.setnowrite()
|
||||||
elif cmd == CMD_TCP_DATA:
|
elif cmd == CMD_TCP_DATA:
|
||||||
self.buf.append(data)
|
self.buf.append(data)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user