summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2003-12-21 18:04:08 +0000
committerclaudio <claudio@openbsd.org>2003-12-21 18:04:08 +0000
commit8d17e738586bf95ffe4b680398cb8f993bdc81f8 (patch)
tree4e94f7dd42e5079b2e3f07c5e5a4a2cd4814bfdf
parentyet more from the castathon; most aspath functions where accessing non- (diff)
downloadwireguard-openbsd-8d17e738586bf95ffe4b680398cb8f993bdc81f8.tar.xz
wireguard-openbsd-8d17e738586bf95ffe4b680398cb8f993bdc81f8.zip
don't try to write out data immediately if there are queued writes.
OK henning@
-rw-r--r--usr.sbin/bgpd/buffer.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/buffer.c b/usr.sbin/bgpd/buffer.c
index 81b11dfec93..0d9f25f6f71 100644
--- a/usr.sbin/bgpd/buffer.c
+++ b/usr.sbin/bgpd/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.4 2003/12/21 16:11:33 claudio Exp $ */
+/* $OpenBSD: buffer.c,v 1.5 2003/12/21 18:04:08 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -85,12 +85,14 @@ buf_close(struct buf *buf)
int n;
- if ((n = buf_write(buf)) == -1)
- return (-1);
+ if (buf->peer != NULL && buf->peer->queued_writes == 0) {
+ if ((n = buf_write(buf)) == -1)
+ return (-1);
- if (n == 1) { /* all data written out */
- buf_free(buf);
- return (0);
+ if (n == 1) { /* all data written out */
+ buf_free(buf);
+ return (0);
+ }
}
/* we have to queue */