mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-22 07:53:43 +01:00
Clean up log messages slightly.
This commit is contained in:
parent
72ed385b7f
commit
dc643ccdc4
11
client.py
11
client.py
@ -15,18 +15,25 @@ def _nb_clean(func, *args):
|
||||
class SockWrapper:
|
||||
def __init__(self, sock):
|
||||
self.sock = sock
|
||||
self.peername = self.sock.getpeername()
|
||||
self.shut_read = self.shut_write = False
|
||||
self.buf = []
|
||||
|
||||
def __del__(self):
|
||||
log('%r: deleting\n' % self)
|
||||
|
||||
def __repr__(self):
|
||||
return 'SW%r' % (self.peername,)
|
||||
|
||||
def noread(self):
|
||||
if not self.shut_read:
|
||||
log('%r: setting noread\n' % self)
|
||||
log('%r: done reading\n' % self)
|
||||
self.shut_read = True
|
||||
#self.sock.shutdown(SHUT_RD) # doesn't do anything anyway
|
||||
|
||||
def nowrite(self):
|
||||
if not self.shut_write:
|
||||
log('%r: setting nowrite\n' % self)
|
||||
log('%r: done writing\n' % self)
|
||||
self.shut_write = True
|
||||
self.sock.shutdown(SHUT_WR)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user