[Quagga-bugs] [Bug 308] request for a better error message
bugzilla-daemon at allevil.dishone.st
bugzilla-daemon at allevil.dishone.st
Tue Oct 17 17:51:15 IST 2006
Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug
report.
http://bugzilla.quagga.net/show_bug.cgi?id=308
------- Additional Comments From ajschorr at alumni.princeton.edu 2006-10-17 16:51 -------
But in fact, the connection is not being closed cleanly. If there
were simply an end-of-file on the socket, there would be no
error message at all. Here is the actual code that generates that message
(in lib/vty.c:vty_read()):
if ((nbytes = read (vty->fd, buf, VTY_READ_BUFSIZ)) <= 0)
{
if (nbytes < 0)
{
if (ERRNO_IO_RETRY(errno))
{
vty_event (VTY_READ, vty_sock, vty);
return 0;
}
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);
vty->status = VTY_CLOSE;
}
So the error message is produced when the return code from the read
system call is less than zero.
If you look at the documentation for read, you will see that there are many
reasons that the read call may return an error. Here is the single unix
spec for read:
http://www.opengroup.org/onlinepubs/009695399/functions/read.html
At the moment, the code is designed to give a very clear and explicit
error message that should enable a programmer to debug what happened.
How do you suggest that the code be changed? If you have a proposed
patch, please submit it. But I fear that any improvement in the error
message would require testing for different values of 'errno', and that
may simply not be worth it.
Another approach would be to enhance the Nagios configuration to
close the socket more cleanly. Is that possible?
Regards,
Andy
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the Quagga-bugs
mailing list