mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-09 15:07:39 +00:00
tests: bmpserver, detect session close immediately
bmpserver infinitely loops after the clients has closed the TCP session.
In this situation, recv() returns empty data.
Detect session close immediately.
Fixes: 875511c466
("topotests: add basic bmp collector")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
This commit is contained in:
parent
6bb0c91d10
commit
ad6c107f91
@ -34,6 +34,9 @@ def main():
|
|||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
data = connection.recv(BGP_MAX_SIZE)
|
data = connection.recv(BGP_MAX_SIZE)
|
||||||
|
if not data:
|
||||||
|
# connection closed
|
||||||
|
break
|
||||||
while len(data) > BMPMsg.MIN_LEN:
|
while len(data) > BMPMsg.MIN_LEN:
|
||||||
data = BMPMsg.dissect(data, log_file=LOG_FILE)
|
data = BMPMsg.dissect(data, log_file=LOG_FILE)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user