Elusive bad-file-descriptor error caught.

git-svn-id: file:///svn/unbound/trunk@1333 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2008-11-05 14:56:49 +00:00
parent 747dc4e3ab
commit 69af0f10e9
3 changed files with 9 additions and 3 deletions

View file

@ -9,6 +9,10 @@
- fixed file descriptor leak for localzone type deny (for TCP).
- fixed memleak at exit for nsec3 negative cached zones.
- fixed memleak for the keyword 'nodefault' when reading config.
- made verbosity of 'edns incapable peer' warning higher, so you
do not get spammed by it.
- caught elusive Bad file descriptor error bug, that would print the
error while unnecessarily try to listen to a closed fd. Fixed.
4 November 2008: Wouter
- fixed -Wwrite-strings warnings that result in better code.

View file

@ -1490,7 +1490,7 @@ serviced_udp_callback(struct comm_point* c, void* arg, int error,
if(sq->status == serviced_query_PROBE_EDNS) {
/* probe without EDNS succeeds, so we conclude that this
* host likely has EDNS packets dropped */
log_addr(VERB_OPS, "timeouts, concluded that connection to "
log_addr(VERB_DETAIL, "timeouts, concluded that connection to "
"host drops EDNS packets", &sq->addr, sq->addrlen);
if(!infra_edns_update(outnet->infra, &sq->addr, sq->addrlen,
-1, (uint32_t)now.tv_sec)) {

View file

@ -503,7 +503,8 @@ comm_point_udp_callback(int fd, short event, void* arg)
if(recv == -1) {
#ifndef USE_WINSOCK
if(errno != EAGAIN && errno != EINTR)
log_err("recvfrom failed: %s", strerror(errno));
log_err("recvfrom %d failed: %s",
fd, strerror(errno));
#else
if(WSAGetLastError() != WSAEINPROGRESS &&
WSAGetLastError() != WSAECONNRESET &&
@ -522,7 +523,8 @@ comm_point_udp_callback(int fd, short event, void* arg)
(void)comm_point_send_udp_msg(rep.c, rep.c->buffer,
(struct sockaddr*)&rep.addr, rep.addrlen);
}
if(rep.c->fd == -1) /* commpoint closed */
if(rep.c->fd != fd) /* commpoint closed to -1 or reused for
another UDP port. Note rep.c cannot be reused with TCP fd. */
break;
}
}