mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-22 16:03:57 +01:00
Fix a socket leak: delete object after close on both direction.
(Note by apenwarr: seems to still work for me. The reason the
problem occurred is that reassigning 'handlers' doesn't change it in its
parent; it creates a whole new list, and the caller still owns the old one
with all the dead sockets in it. The problem seems to have been introduced
in commit 84376284db
when I factored the
runonce() functionality out of the client and server but didn't notice this
reassignment.)
This commit is contained in:
parent
918725c485
commit
7354600849
5
ssnet.py
5
ssnet.py
@ -468,7 +468,10 @@ def runonce(handlers, mux):
|
|||||||
r = []
|
r = []
|
||||||
w = []
|
w = []
|
||||||
x = []
|
x = []
|
||||||
handlers = filter(lambda s: s.ok, handlers)
|
to_remove = filter(lambda s: not s.ok, handlers)
|
||||||
|
for h in to_remove:
|
||||||
|
handlers.remove(h)
|
||||||
|
|
||||||
for s in handlers:
|
for s in handlers:
|
||||||
s.pre_select(r,w,x)
|
s.pre_select(r,w,x)
|
||||||
debug2('Waiting: %d r=%r w=%r x=%r (fullness=%d/%d)\n'
|
debug2('Waiting: %d r=%r w=%r x=%r (fullness=%d/%d)\n'
|
||||||
|
Loading…
Reference in New Issue
Block a user