2010-09-21 Pierre Humblet <Pierre.Humblet@ieee.org>
* libc/minires.c (res_nsend): Use the Windows resolver if appropriate. (dn_expand): Only set errno in case of error. Delete old comments. (dn_skipname): Fix typo in comment.
This commit is contained in:
parent
b53c1929e5
commit
5c22068f7f
@ -1,3 +1,9 @@
|
|||||||
|
2010-09-21 Pierre Humblet <Pierre.Humblet@ieee.org>
|
||||||
|
|
||||||
|
* libc/minires.c (res_nsend): Use the Windows resolver if appropriate.
|
||||||
|
(dn_expand): Only set errno in case of error. Delete old comments.
|
||||||
|
(dn_skipname): Fix typo in comment.
|
||||||
|
|
||||||
2010-09-21 Corinna Vinschen <corinna@vinschen.de>
|
2010-09-21 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* path.cc (cwdstuff::set): Replace constant 2 with sizeof(WCHAR) where
|
* path.cc (cwdstuff::set): Replace constant 2 with sizeof(WCHAR) where
|
||||||
|
@ -437,6 +437,26 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr,
|
|||||||
if (((statp->options & RES_INIT) == 0) && (res_ninit(statp) != 0))
|
if (((statp->options & RES_INIT) == 0) && (res_ninit(statp) != 0))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/* If a hook exists to a native implementation, use it */
|
||||||
|
if (statp->os_query) {
|
||||||
|
int len;
|
||||||
|
short int Class, Type;
|
||||||
|
unsigned char DomName[MAXDNAME];
|
||||||
|
unsigned char * ptr = MsgPtr + HFIXEDSZ;
|
||||||
|
len = dn_expand(MsgPtr, MsgPtr + MsgLength, ptr, DomName, sizeof(DomName));
|
||||||
|
if (len > 0) {
|
||||||
|
ptr += len;
|
||||||
|
GETSHORT(Type, ptr);
|
||||||
|
GETSHORT(Class, ptr);
|
||||||
|
return ((os_query_t *) statp->os_query)(statp, DomName, Class, Type, AnsPtr, AnsLength);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* dn_expand sets errno */
|
||||||
|
statp->res_h_errno = NETDB_INTERNAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Close the socket if it had been opened before a fork.
|
/* Close the socket if it had been opened before a fork.
|
||||||
Reuse of pid's cannot hurt */
|
Reuse of pid's cannot hurt */
|
||||||
if ((statp->sockfd != -1) && (statp->mypid != getpid())) {
|
if ((statp->sockfd != -1) && (statp->mypid != getpid())) {
|
||||||
@ -808,9 +828,7 @@ int dn_expand(const unsigned char *msg, const unsigned char *eomorig,
|
|||||||
{
|
{
|
||||||
unsigned int len, complen = 0;
|
unsigned int len, complen = 0;
|
||||||
const unsigned char *comp_dn_orig = comp_dn;
|
const unsigned char *comp_dn_orig = comp_dn;
|
||||||
/* char * exp_start = exp_dn; */
|
|
||||||
|
|
||||||
errno = EINVAL;
|
|
||||||
if (comp_dn >= eomorig)
|
if (comp_dn >= eomorig)
|
||||||
goto expand_fail;
|
goto expand_fail;
|
||||||
if ((len = *comp_dn++) == 0) /* Weird case */
|
if ((len = *comp_dn++) == 0) /* Weird case */
|
||||||
@ -843,7 +861,7 @@ int dn_expand(const unsigned char *msg, const unsigned char *eomorig,
|
|||||||
return complen;
|
return complen;
|
||||||
|
|
||||||
expand_fail:
|
expand_fail:
|
||||||
/* fprintf(stderr, "dn_expand fails\n"); */
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -962,7 +980,7 @@ int dn_skipname(const unsigned char *comp_dn, const unsigned char *eom)
|
|||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
* dn_length1 For internal use
|
* dn_length1 For internal use
|
||||||
|
|
||||||
Return length of uncompressesed name incl final 0.
|
Return length of uncompressed name incl final 0.
|
||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
|
|
||||||
int dn_length1(const unsigned char *msg, const unsigned char *eomorig,
|
int dn_length1(const unsigned char *msg, const unsigned char *eomorig,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user