mirror of git://sourceware.org/git/glibc.git
Update.
* resolv/res_send.c: Compiling with DEBUG defined works again. * resolv/gethnamaddr.c (dprintf): Renamed to Dprintf. Adjust all callers.
This commit is contained in:
parent
0b3cce3139
commit
020a9a23e2
|
|
@ -1,5 +1,9 @@
|
||||||
2004-08-08 Ulrich Drepper <drepper@redhat.com>
|
2004-08-08 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* resolv/res_send.c: Compiling with DEBUG defined works again.
|
||||||
|
* resolv/gethnamaddr.c (dprintf): Renamed to Dprintf. Adjust all
|
||||||
|
callers.
|
||||||
|
|
||||||
* resolv/tst-leaks.c (TIMEOUT): Define so that if no server is
|
* resolv/tst-leaks.c (TIMEOUT): Define so that if no server is
|
||||||
available the process is not killed. [BZ #41]
|
available the process is not killed. [BZ #41]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ extern int h_errno;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
static void
|
static void
|
||||||
dprintf(msg, num)
|
Dprintf(msg, num)
|
||||||
char *msg;
|
char *msg;
|
||||||
int num;
|
int num;
|
||||||
{
|
{
|
||||||
|
|
@ -155,7 +155,7 @@ dprintf(msg, num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define dprintf(msg, num) /*nada*/
|
# define Dprintf(msg, num) /*nada*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BOUNDED_INCR(x) \
|
#define BOUNDED_INCR(x) \
|
||||||
|
|
@ -429,13 +429,13 @@ getanswer(answer, anslen, qname, qtype)
|
||||||
bp += sizeof(align) - ((u_long)bp % sizeof(align));
|
bp += sizeof(align) - ((u_long)bp % sizeof(align));
|
||||||
|
|
||||||
if (bp + n >= &hostbuf[sizeof hostbuf]) {
|
if (bp + n >= &hostbuf[sizeof hostbuf]) {
|
||||||
dprintf("size (%d) too big\n", n);
|
Dprintf("size (%d) too big\n", n);
|
||||||
had_error++;
|
had_error++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (hap >= &h_addr_ptrs[MAXADDRS-1]) {
|
if (hap >= &h_addr_ptrs[MAXADDRS-1]) {
|
||||||
if (!toobig++) {
|
if (!toobig++) {
|
||||||
dprintf("Too many addresses (%d)\n",
|
Dprintf("Too many addresses (%d)\n",
|
||||||
MAXADDRS);
|
MAXADDRS);
|
||||||
}
|
}
|
||||||
cp += n;
|
cp += n;
|
||||||
|
|
@ -627,7 +627,7 @@ gethostbyname2(name, af)
|
||||||
&buf.ptr)) < 0) {
|
&buf.ptr)) < 0) {
|
||||||
if (buf.buf != origbuf)
|
if (buf.buf != origbuf)
|
||||||
free (buf.buf);
|
free (buf.buf);
|
||||||
dprintf("res_nsearch failed (%d)\n", n);
|
Dprintf("res_nsearch failed (%d)\n", n);
|
||||||
if (errno == ECONNREFUSED)
|
if (errno == ECONNREFUSED)
|
||||||
return (_gethtbyname2(name, af));
|
return (_gethtbyname2(name, af));
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
@ -729,7 +729,7 @@ gethostbyaddr(addr, len, af)
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
if (buf.buf != orig_buf)
|
if (buf.buf != orig_buf)
|
||||||
free (buf.buf);
|
free (buf.buf);
|
||||||
dprintf("res_nquery failed (%d)\n", n);
|
Dprintf("res_nquery failed (%d)\n", n);
|
||||||
if (errno == ECONNREFUSED)
|
if (errno == ECONNREFUSED)
|
||||||
return (_gethtbyaddr(addr, len, af));
|
return (_gethtbyaddr(addr, len, af));
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ static int send_dg(res_state, const u_char *, int,
|
||||||
int *, int *, u_char **);
|
int *, int *, u_char **);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
static void Aerror(const res_state, FILE *, const char *, int,
|
static void Aerror(const res_state, FILE *, const char *, int,
|
||||||
struct sockaddr_in);
|
const struct sockaddr *);
|
||||||
static void Perror(const res_state, FILE *, const char *, int);
|
static void Perror(const res_state, FILE *, const char *, int);
|
||||||
#endif
|
#endif
|
||||||
#ifdef _LIBC
|
#ifdef _LIBC
|
||||||
|
|
@ -576,9 +576,17 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
|
||||||
} while (!done);
|
} while (!done);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
char tmpbuf[40];
|
||||||
|
Dprint(statp->options & RES_DEBUG,
|
||||||
|
(stdout, ";; Querying server (# %d) address = %s\n",
|
||||||
|
ns + 1, inet_ntop(AF_INET6, &nsap->sin6_addr,
|
||||||
|
tmpbuf, sizeof (tmpbuf))));
|
||||||
|
#else
|
||||||
Dprint(statp->options & RES_DEBUG,
|
Dprint(statp->options & RES_DEBUG,
|
||||||
(stdout, ";; Querying server (# %d) address = %s\n",
|
(stdout, ";; Querying server (# %d) address = %s\n",
|
||||||
ns + 1, inet_ntoa(nsap->sin_addr)));
|
ns + 1, inet_ntoa(nsap->sin_addr)));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (v_circuit) {
|
if (v_circuit) {
|
||||||
/* Use VC; at most one attempt per server. */
|
/* Use VC; at most one attempt per server. */
|
||||||
|
|
@ -610,7 +618,7 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
|
||||||
|
|
||||||
DprintQ((statp->options & RES_DEBUG) ||
|
DprintQ((statp->options & RES_DEBUG) ||
|
||||||
(statp->pfcode & RES_PRF_REPLY),
|
(statp->pfcode & RES_PRF_REPLY),
|
||||||
(stdout, ""),
|
(stdout, "%s", ""),
|
||||||
ans, (resplen > anssiz) ? anssiz : resplen);
|
ans, (resplen > anssiz) ? anssiz : resplen);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -743,7 +751,8 @@ send_vc(res_state statp,
|
||||||
if (connect(statp->_vcsock, (struct sockaddr *)nsap,
|
if (connect(statp->_vcsock, (struct sockaddr *)nsap,
|
||||||
sizeof *nsap) < 0) {
|
sizeof *nsap) < 0) {
|
||||||
*terrno = errno;
|
*terrno = errno;
|
||||||
Aerror(statp, stderr, "connect/vc", errno, *nsap);
|
Aerror(statp, stderr, "connect/vc", errno,
|
||||||
|
(struct sockaddr *) nsap);
|
||||||
res_nclose(statp);
|
res_nclose(statp);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
@ -948,7 +957,8 @@ send_dg(res_state statp,
|
||||||
*/
|
*/
|
||||||
if (connect(EXT(statp).nssocks[ns], (struct sockaddr *)nsap,
|
if (connect(EXT(statp).nssocks[ns], (struct sockaddr *)nsap,
|
||||||
sizeof *nsap) < 0) {
|
sizeof *nsap) < 0) {
|
||||||
Aerror(statp, stderr, "connect(dg)", errno, *nsap);
|
Aerror(statp, stderr, "connect(dg)", errno,
|
||||||
|
(struct sockaddr *) nsap);
|
||||||
res_nclose(statp);
|
res_nclose(statp);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
@ -972,7 +982,8 @@ send_dg(res_state statp,
|
||||||
if (sendto(s, (char*)buf, buflen, 0,
|
if (sendto(s, (char*)buf, buflen, 0,
|
||||||
(struct sockaddr *)nsap, sizeof *nsap) != buflen)
|
(struct sockaddr *)nsap, sizeof *nsap) != buflen)
|
||||||
{
|
{
|
||||||
Aerror(statp, stderr, "sendto", errno, *nsap);
|
Aerror(statp, stderr, "sendto", errno,
|
||||||
|
(struct sockaddr *) nsap);
|
||||||
res_nclose(statp);
|
res_nclose(statp);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
@ -1130,18 +1141,22 @@ send_dg(res_state statp,
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
static void
|
static void
|
||||||
Aerror(const res_state statp, FILE *file, const char *string, int error,
|
Aerror(const res_state statp, FILE *file, const char *string, int error,
|
||||||
struct sockaddr_in address)
|
const struct sockaddr *address)
|
||||||
{
|
{
|
||||||
int save = errno;
|
int save = errno;
|
||||||
|
|
||||||
if ((statp->options & RES_DEBUG) != 0) {
|
if ((statp->options & RES_DEBUG) != 0) {
|
||||||
char tmp[sizeof "255.255.255.255"];
|
char tmp[sizeof "xxxx.xxxx.xxxx.255.255.255.255"];
|
||||||
|
|
||||||
fprintf(file, "res_send: %s ([%s].%u): %s\n",
|
fprintf(file, "res_send: %s ([%s].%u): %s\n",
|
||||||
string,
|
string,
|
||||||
inet_ntop(address.sin_family, &address.sin_addr,
|
inet_ntop(address->sa_family, address->sa_data,
|
||||||
tmp, sizeof tmp),
|
tmp, sizeof tmp),
|
||||||
ntohs(address.sin_port),
|
(address->sa_family == AF_INET
|
||||||
|
? ntohs(((struct sockaddr_in *) address)->sin_port)
|
||||||
|
: address->sa_family == AF_INET6
|
||||||
|
? ntohs(((struct sockaddr_in6 *) address)->sin6_port)
|
||||||
|
: 0),
|
||||||
strerror(error));
|
strerror(error));
|
||||||
}
|
}
|
||||||
__set_errno (save);
|
__set_errno (save);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue