2846. [bug] EOF on unix domain sockets was not being handled

correctly. [RT #20731]
This commit is contained in:
Mark Andrews
2010-01-31 23:21:58 +00:00
parent 366694ad6a
commit b4d6057cf0
2 changed files with 19 additions and 6 deletions
+3
View File
@@ -1,4 +1,7 @@
2844. [doc] notify-delay default in ARM was wrong. It should have
2846. [bug] EOF on unix domain sockets was not being handled
correctly. [RT #20731]
been five (5) seconds.
--- 9.6.2rc1 released ---
+16 -6
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: socket.c,v 1.308.12.10 2009/09/07 02:11:57 marka Exp $ */
/* $Id: socket.c,v 1.308.12.11 2010/01/31 23:21:58 marka Exp $ */
/*! \file */
@@ -1520,12 +1520,22 @@ doio_recv(isc_socket_t *sock, isc_socketevent_t *dev) {
}
/*
* On TCP, zero length reads indicate EOF, while on
* UDP, zero length reads are perfectly valid, although
* strange.
* On TCP and UNIX sockets, zero length reads indicate EOF,
* while on UDP sockets, zero length reads are perfectly valid,
* although strange.
*/
if ((sock->type == isc_sockettype_tcp) && (cc == 0))
return (DOIO_EOF);
switch (sock->type) {
case isc_sockettype_tcp:
case isc_sockettype_unix:
if (cc == 0)
return (DOIO_EOF);
break;
case isc_sockettype_udp:
break;
case isc_sockettype_fdwatch:
default:
INSIST(0);
}
if (sock->type == isc_sockettype_udp) {
dev->address.length = msghdr.msg_namelen;