mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 09:32:21 +00:00
Cap the number of deferred packets
Prevent deferred packets from growing endlessly if activity is keeping the loop running.
This commit is contained in:
parent
60cfa1d3c5
commit
cde18bcd3a
@ -482,7 +482,7 @@ def snoop(handler, protocol=None):
|
||||
known_peers = set([])
|
||||
peerbymacaddress = {}
|
||||
deferpeers = []
|
||||
while r:
|
||||
while r and len(deferpeers) < 256:
|
||||
for s in r:
|
||||
(rsp, peer) = s.recvfrom(9000)
|
||||
if peer in known_peers:
|
||||
|
@ -173,7 +173,7 @@ def snoop(handler, byehandler=None, protocol=None, uuidlookup=None):
|
||||
if r:
|
||||
r = r[0]
|
||||
recent_peers = set([])
|
||||
while r:
|
||||
while r and len(deferrednotifies) < 256:
|
||||
for s in r:
|
||||
(rsp, peer) = s.recvfrom(9000)
|
||||
if rsp[:4] == b'PING':
|
||||
|
Loading…
Reference in New Issue
Block a user