bgpd: stop pseudo-blocking in bgp_write

If write() indicates that we should retry, just move along to the next
peer and come back later. No need to burn write() in a loop.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2017-03-31 16:55:52 +00:00
parent 419dfe6a70
commit 2bb745fe02
No known key found for this signature in database
GPG Key ID: DAF48E0F57E0834F

View File

@ -2202,10 +2202,9 @@ static int bgp_write(struct peer *peer)
num = write(peer->fd, STREAM_PNT(s), writenum);
if (num < 0) {
if (ERRNO_IO_RETRY(errno))
continue;
if (!ERRNO_IO_RETRY(errno))
BGP_EVENT_ADD(peer, TCP_fatal_error);
goto done;
} else if (num != writenum) // incomplete write
stream_forward_getp(s, num);