summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/session.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-12-23 15:15:56 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-12-23 15:15:56 +0000
commit15714073687d484a6fc6da8772b8a802ef3beab1 (patch)
tree459128b80bdad2a0d443226aaa08b4bb9a71c0ad /usr.sbin/bgpd/session.c
parent45dcf3deef81b749cfb074b4ad1b77c0cf7ade0f (diff)
lower latency by processing no more than 25 messages at once for each peer
Diffstat (limited to 'usr.sbin/bgpd/session.c')
-rw-r--r--usr.sbin/bgpd/session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index e881f05c45a..6fab38bfd8e 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.209 2004/12/07 17:19:09 henning Exp $ */
+/* $OpenBSD: session.c,v 1.210 2004/12/23 15:15:55 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1421,7 +1421,7 @@ session_dispatch_msg(struct pollfd *pfd, struct peer *p)
{
ssize_t n, rpos, av, left;
socklen_t len;
- int error;
+ int error, processed = 0;
u_int16_t msglen;
u_int8_t msgtype;
@@ -1537,6 +1537,8 @@ session_dispatch_msg(struct pollfd *pfd, struct peer *p)
"unknown type %u", msgtype);
}
rpos += msglen;
+ if (++processed > MSG_PROCESS_LIMIT)
+ break;
}
if (p->rbuf == NULL)
return (1);