Skip to content

Commit 117afc7

Browse files
vieirabrianmay
authored andcommitted
Fixed dictionary changed size during iteration
The removal loop should probably be outside the iteration loop.
1 parent c619840 commit 117afc7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sshuttle/server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,14 @@ def udp_open(channel, data):
334334
debug3('expiring dnsreqs channel=%d\n' % channel)
335335
remove.append(channel)
336336
h.ok = False
337-
for channel in remove:
338-
del dnshandlers[channel]
337+
for channel in remove:
338+
del dnshandlers[channel]
339339
if udphandlers:
340340
remove = []
341341
for channel, h in udphandlers.items():
342342
if not h.ok:
343343
debug3('expiring UDP channel=%d\n' % channel)
344344
remove.append(channel)
345345
h.ok = False
346-
for channel in remove:
347-
del udphandlers[channel]
346+
for channel in remove:
347+
del udphandlers[channel]

0 commit comments

Comments
 (0)