summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2013-01-11 18:27:23 +0000
committerDavid Lamparter <equinox@opensourcerouting.org>2013-01-15 17:50:34 +0100
commit3a69f74a0a903659e8a5bb930b257d9d09a87626 (patch)
treee54c3459cbd555d66d915c92f64dcc3a6b90cca2
parentd61c1bbd4bf6ddf717dda88350668a9f1e2da0ac (diff)
bgpd: uncork after each write
Keep data flowing, uncork after each BGP_WRITE_PACKET_MAX. This makes TCP send data sooner, since thread may not be scheduled again for a a longish time because of new UPDATE's coming in. Signed-off-by: Stephen Hemminger <shemminger@vyatta.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--bgpd/bgp_packet.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 02863d75..b0918fc5 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -677,7 +677,8 @@ bgp_write (struct thread *thread)
/* Flush any existing events */
BGP_EVENT_ADD (peer, BGP_Stop);
- return 0;
+ goto done;
+
case BGP_MSG_KEEPALIVE:
peer->keepalive_out++;
break;
@@ -698,9 +699,9 @@ bgp_write (struct thread *thread)
if (bgp_write_proceed (peer))
BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
- else
- sockopt_cork (peer->fd, 0);
-
+
+ done:
+ sockopt_cork (peer->fd, 0);
return 0;
}