summaryrefslogtreecommitdiffstats
path: root/contrib/bind/named/ns_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bind/named/ns_main.c')
-rw-r--r--contrib/bind/named/ns_main.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/contrib/bind/named/ns_main.c b/contrib/bind/named/ns_main.c
index 6fff4cc..7f88082 100644
--- a/contrib/bind/named/ns_main.c
+++ b/contrib/bind/named/ns_main.c
@@ -1,6 +1,6 @@
#if !defined(lint) && !defined(SABER)
static char sccsid[] = "@(#)ns_main.c 4.55 (Berkeley) 7/1/91";
-static char rcsid[] = "$Id: ns_main.c,v 8.24 1996/11/26 10:11:22 vixie Exp $";
+static char rcsid[] = "$Id: ns_main.c,v 8.25 1997/06/01 20:34:34 vixie Exp $";
#endif /* not lint */
/*
@@ -172,7 +172,7 @@ main(argc, argv, envp)
const int on = 1;
int rfd, size, len;
time_t lasttime, maxctime;
- u_char buf[BUFSIZ];
+ u_char buf[PACKETSZ];
#ifdef NeXT
int old_sigmask;
#endif
@@ -833,7 +833,7 @@ main(argc, argv, envp)
malloc(rbufsize))
) {
sp->s_buf = buf;
- sp->s_size = sizeof(buf);
+ sp->s_bufsize=sizeof(buf);
} else {
sp->s_bufsize = rbufsize;
}
@@ -866,6 +866,12 @@ main(argc, argv, envp)
sp->s_bufp += n;
sp->s_size -= n;
}
+
+ if (sp->s_size > 0 &&
+ (n == -1) &&
+ (errno == PORT_WOULDBLK))
+ continue;
+
/*
* we don't have enough memory for the query.
* if we have a query id, then we will send an
@@ -886,8 +892,10 @@ main(argc, argv, envp)
(void) writemsg(sp->s_rfd, sp->s_buf,
HFIXEDSZ);
}
+ sqrm(sp);
continue;
}
+
/*
* If the message is too short to contain a valid
* header, try to send back an error, and drop the
@@ -908,10 +916,9 @@ main(argc, argv, envp)
(void) writemsg(sp->s_rfd, sp->s_buf,
HFIXEDSZ);
}
+ sqrm(sp);
continue;
}
- if ((n == -1) && (errno == PORT_WOULDBLK))
- continue;
if (n <= 0) {
sqrm(sp);
continue;
OpenPOWER on IntegriCloud