aboutsummaryrefslogtreecommitdiff
path: root/resolv/res_send.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1996-10-12 00:56:05 +0000
committerUlrich Drepper <drepper@redhat.com>1996-10-12 00:56:05 +0000
commit1f64ac13c02e70285e26a0572d9393a3ee0f9ad8 (patch)
tree8f146d2ac4d9c1afb5206d403352d7889a006891 /resolv/res_send.c
parentb33f91e91da81059b388c8f8ee0d0024212eb180 (diff)
downloadglibc-1f64ac13c02e70285e26a0572d9393a3ee0f9ad8.tar
glibc-1f64ac13c02e70285e26a0572d9393a3ee0f9ad8.tar.gz
glibc-1f64ac13c02e70285e26a0572d9393a3ee0f9ad8.tar.bz2
glibc-1f64ac13c02e70285e26a0572d9393a3ee0f9ad8.zip
update from main archive 961011
Fri Oct 11 19:13:34 1996 Ulrich Drepper <drepper@cygnus.com> * locale/Makefile (CPPFLAGS): Set CHARMAP_PATH to "$(i18ndir)/charmaps". Fri Oct 11 22:12:41 1996 NIIBE Yutaka <gniibe@mri.co.jp> * sysdeps/unix/sysv/linux/sys/procfs.h: Include <asm/user.h> to get definition of FPU description struct. * sysdeps/unix/sysv/linux/Makefile [$(subdir)=socket] (subdir_headers): Add net/if.h, net/if_ppp.h, net/ppp-comp.h, net/ppp_defs.h, net/if_arp.h, and net/route.h. * sysdeps/unix/sysv/linux/net/if_arp.h: New file. * sysdeps/unix/sysv/linux/net/route.h: New file. Fri Oct 11 14:49:13 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/stub/readdir_r.c: New file. We need a stub version. * sysdeps/stub/e_acosl.c: Likewise. * sysdeps/stub/e_asinl.c: Likewise. * sysdeps/stub/e_atan2l.c: Likewise. * sysdeps/stub/e_expl.c: Likewise. * sysdeps/stub/e_fmodl.c: Likewise. * sysdeps/stub/e_log10l.c: Likewise. * sysdeps/stub/e_logl.c: Likewise. * sysdeps/stub/e_sqrtl.c: Likewise. * sysdeps/stub/s_atanl.c: Likewise. * sysdeps/stub/s_log1pl.c: Likewise. * Makefile (distribute): Add nsswitch.h and netgroup.h. * nss/Makefile (generated): db-netgrp.c is not generated. * sysdeps/alpha/Dist: Add stxcpy.S and stxncpy.S. * Make-dist (+out): Add $(dont_distribute). Fri Oct 11 00:27:18 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * stdio-common/Makefile (routines): Add tmpnam_r. Fri Oct 11 05:32:51 1996 Ulrich Drepper <drepper@cygnus.com> * version.h: Bump version to 1.96. Fri Oct 11 18:13:47 1996 Andreas Jaeger <aj@arthur.pfalz.de> * stdio-common/tst-printf.c: Some more cleanups. Fri Oct 11 02:48:02 1996 Ulrich Drepper <drepper@cygnus.com> * resolv/arpa/nameser.h: Update from bind-4.9.5-T6B. * resolv/resolv.h: Likewise. * resolv/gethnamaddr.c: Likewise. * resolv/res_comp.c: Likewise. * resolv/res_debug.c: Likewise. * resolv/res_init.c: Likewise. * resolv/res_send.c: Likewise. * resolv/Banner: Update version number. * nss/nss_dns/dns-host.c: Update according to change in resolv/gethnamaddr.c. Fri Oct 10 20:52:28 1996 Ralph Loader <loader@maths.ox.ac.uk> * crypt/md5.c (md5_stream): When reading the block in several pieces append to instead of replace previously read data. Thu Oct 10 15:53:17 1996 Richard Henderson <rth@tamu.edu> * sysdeps/alpha/stxcpy.S ($unaligned): In single word copy, correct last-byte-written bit for source word misalignment. * sysdeps/alpha/strchr.c: Removed. There is now an assembler version. Thu Oct 10 17:17:23 1996 Ulrich Drepper <drepper@cygnus.com> * sunrpc/Makefile (rpcsvc): Remove yp.x. The corrected version comes with glibc-nis. * sunrpc/rpcsvc/yp.x: Removed. * nss/nss_files/files-netgr.c (_nss_netgroup_parseline): Test for *CURSOR to be NULL and dump a core if yes. Thu Oct 9 20:09:53 1996 Matthew Jacob <mjacob@feral.com> * sysdeps/unix/sysv/linux/alpha/brk.S: Define _ERRNO_H before including <errnos.h> to get error numbers. Thu Oct 10 14:00:01 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/i386/sigcontext.h: Moved file... * sysdeps/unix/sysv/linux/sigcontext.h: ...to here. So the Alpha people find a correct file. * sysdeps/libm-ieee754/w_cabs.c: We cannot make __cabsl simply an alias of __cabs since the structures have different names. * sysdeps/libm-ieee754/w_log10.c: Fix typo in weak_alias. Reported by Matthew Jacob <mjacob@feral.com>. simply a wrapper around the <linux/elfcore.h> file since the
Diffstat (limited to 'resolv/res_send.c')
-rw-r--r--resolv/res_send.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 3efc6cf96f..a5b4fba44b 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -94,8 +94,6 @@ static char rcsid[] = "$Id$";
# include <../conf/options.h>
#endif
-void _res_close __P((void));
-
static int s = -1; /* socket used for communications */
static int connected = 0; /* is the socket connected */
static int vc = 0; /* is the socket a virtual ciruit? */
@@ -320,7 +318,7 @@ res_send(buf, buflen, ans, anssiz)
struct sockaddr_in *nsap = &_res.nsaddr_list[ns];
same_ns:
if (badns & (1 << ns)) {
- _res_close();
+ res_close();
goto next_ns;
}
@@ -337,7 +335,7 @@ res_send(buf, buflen, ans, anssiz)
done = 1;
break;
case res_nextns:
- _res_close();
+ res_close();
goto next_ns;
case res_done:
return (resplen);
@@ -372,7 +370,7 @@ res_send(buf, buflen, ans, anssiz)
truncated = 0;
if ((s < 0) || (!vc)) {
if (s >= 0)
- _res_close();
+ res_close();
s = socket(PF_INET, SOCK_STREAM, 0);
if (s < 0) {
@@ -387,7 +385,7 @@ res_send(buf, buflen, ans, anssiz)
Aerror(stderr, "connect/vc",
errno, *nsap);
badns |= (1 << ns);
- _res_close();
+ res_close();
goto next_ns;
}
vc = 1;
@@ -404,7 +402,7 @@ res_send(buf, buflen, ans, anssiz)
terrno = errno;
Perror(stderr, "write failed", errno);
badns |= (1 << ns);
- _res_close();
+ res_close();
goto next_ns;
}
/*
@@ -421,7 +419,7 @@ read_len:
if (n <= 0) {
terrno = errno;
Perror(stderr, "read failed", errno);
- _res_close();
+ res_close();
/*
* A long running process might get its TCP
* connection reset if the remote server was
@@ -433,10 +431,10 @@ read_len:
*/
if (terrno == ECONNRESET && !connreset) {
connreset = 1;
- _res_close();
+ res_close();
goto same_ns;
}
- _res_close();
+ res_close();
goto next_ns;
}
resplen = _getshort(ans);
@@ -457,7 +455,7 @@ read_len:
if (n <= 0) {
terrno = errno;
Perror(stderr, "read(vc)", errno);
- _res_close();
+ res_close();
goto next_ns;
}
if (truncated) {
@@ -504,7 +502,7 @@ read_len:
if ((s < 0) || vc) {
if (vc)
- _res_close();
+ res_close();
s = socket(PF_INET, SOCK_DGRAM, 0);
if (s < 0) {
#if !CAN_RECONNECT
@@ -544,7 +542,7 @@ read_len:
"connect(dg)",
errno, *nsap);
badns |= (1 << ns);
- _res_close();
+ res_close();
goto next_ns;
}
connected = 1;
@@ -552,7 +550,7 @@ read_len:
if (send(s, (char*)buf, buflen, 0) != buflen) {
Perror(stderr, "send", errno);
badns |= (1 << ns);
- _res_close();
+ res_close();
goto next_ns;
}
} else {
@@ -589,7 +587,7 @@ read_len:
!= buflen) {
Aerror(stderr, "sendto", errno, *nsap);
badns |= (1 << ns);
- _res_close();
+ res_close();
goto next_ns;
}
}
@@ -612,7 +610,7 @@ read_len:
if (errno == EINTR)
goto wait;
Perror(stderr, "select", errno);
- _res_close();
+ res_close();
goto next_ns;
}
if (n == 0) {
@@ -622,7 +620,7 @@ read_len:
Dprint(_res.options & RES_DEBUG,
(stdout, ";; timeout\n"));
gotsomewhere = 1;
- _res_close();
+ res_close();
goto next_ns;
}
__set_errno (0);
@@ -631,7 +629,7 @@ read_len:
(struct sockaddr *)&from, &fromlen);
if (resplen <= 0) {
Perror(stderr, "recvfrom", errno);
- _res_close();
+ res_close();
goto next_ns;
}
gotsomewhere = 1;
@@ -683,7 +681,7 @@ read_len:
(stdout, "server rejected query:\n"),
ans, (resplen>anssiz)?anssiz:resplen);
badns |= (1 << ns);
- _res_close();
+ res_close();
/* don't retry if called from dig */
if (!_res.pfcode)
goto next_ns;
@@ -696,7 +694,7 @@ read_len:
Dprint(_res.options & RES_DEBUG,
(stdout, ";; truncated answer\n"));
v_circuit = 1;
- _res_close();
+ res_close();
goto same_ns;
}
} /*if vc/dg*/
@@ -718,7 +716,7 @@ read_len:
*/
if ((v_circuit && (!(_res.options & RES_USEVC) || ns != 0)) ||
!(_res.options & RES_STAYOPEN)) {
- _res_close();
+ res_close();
}
if (Rhook) {
int done = 0, loops = 0;
@@ -734,7 +732,7 @@ read_len:
done = 1;
break;
case res_nextns:
- _res_close();
+ res_close();
goto next_ns;
case res_modified:
/* give the hook another try */
@@ -753,7 +751,7 @@ read_len:
next_ns: ;
} /*foreach ns*/
} /*foreach retry*/
- _res_close();
+ res_close();
if (!v_circuit)
if (!gotsomewhere)
__set_errno (ECONNREFUSED); /* no nameservers found */
@@ -772,7 +770,7 @@ read_len:
* This routine is not expected to be user visible.
*/
void
-_res_close()
+res_close()
{
if (s >= 0) {
(void) close(s);
@@ -787,6 +785,12 @@ _res_close()
* there is more gunk of this kind over in res_debug.c.
*/
+void
+_res_close()
+{
+ res_close();
+}
+
#undef res_send
int
res_send(buf, buflen, ans, anssiz)