summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2015-05-14 14:24:06 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2015-05-27 20:34:41 +0200
commit90d313578f035110422799ca2e188d745ceb3733 (patch)
tree9ec0ef3c8cca4cb52dc5d1340f2a3cb8191ae586 /lib
parent464ccf36b4aa1b942cad413ea30267b4bf9e6315 (diff)
downloadquagga-90d313578f035110422799ca2e188d745ceb3733.tar.bz2
quagga-90d313578f035110422799ca2e188d745ceb3733.tar.xz
lib/vty: don't clear output buffer on input EOF
A VTY's input can be closed without the output becoming unavailable. This happens both on stdio when stdin ends, as well as over TCP when an unidirectional input shutdown() happens. In such a case, resetting the output buffer is not appropriate since there might still be data to be successfully written. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/vty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 3477f638..d0028580 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -1364,8 +1364,8 @@ vty_read (struct thread *thread)
vty->monitor = 0; /* disable monitoring to avoid infinite recursion */
zlog_warn("%s: read error on vty client fd %d, closing: %s",
__func__, vty->fd, safe_strerror(errno));
+ buffer_reset(vty->obuf);
}
- buffer_reset(vty->obuf);
vty->status = VTY_CLOSE;
}