diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-03-05 13:17:15 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-03-05 13:17:15 +0000 |
commit | 651975aa6fc2e62410df36a1458cd6ca7561939a (patch) | |
tree | d6b4007227470d59b5a7b2b6f1eb094e3060d6e1 /usr.sbin/bgpd | |
parent | fc395ed2500e1a3a2cb9bdffa9758dafa0dcb9d6 (diff) |
when a session that had a tcp connection established is pushed back to IDLE,
try to write out what is left in the rite buffers. now notifications do reach
the peer...
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/session.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index c72b899d3c1..35f956d8cad 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.121 2004/02/26 16:16:41 claudio Exp $ */ +/* $OpenBSD: session.c,v 1.122 2004/03/05 13:17:14 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -649,6 +649,13 @@ change_state(struct peer *peer, enum session_state state, switch (state) { case STATE_IDLE: /* + * try to write out what's buffered (maybe a notification), + * don't bother if it fails + */ + if (peer->state >= STATE_OPENSENT && peer->wbuf.queued) + msgbuf_write(&peer->wbuf); + + /* * we must start the timer for the next EVNT_START * if we are coming here due to an error and the * session was not established successfully before, the |