From 4020903675a3a8b04ca739ced056bd39179eeedc Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Sun, 21 Dec 2003 18:04:09 +0000 Subject: don't try to write out data immediately if there are queued writes. OK henning@ --- usr.sbin/bgpd/buffer.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'usr.sbin') 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 @@ -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 */ -- cgit v1.2.3