Bugzilla bug 231786: extended PR_GetAddrInfoByName to support PR_AF_INET.

The patch was contributed by John G. Myers <jgmyers@speakeasy.net>. r=wtc
and darin.
This commit is contained in:
wchang0222%aol.com 2004-01-22 22:27:23 +00:00
parent 608059012f
commit 22ba8cf725

View File

@ -2056,7 +2056,7 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInfoByName(const char *hostname,
PRIntn flags)
{
/* restrict input to supported values */
if (af != PR_AF_UNSPEC || flags != PR_AI_ADDRCONFIG) {
if ((af != PR_AF_INET && af != PR_AF_UNSPEC) || flags != PR_AI_ADDRCONFIG) {
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return NULL;
}
@ -2083,7 +2083,7 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInfoByName(const char *hostname,
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_CANONNAME;
hints.ai_family = AF_UNSPEC;
hints.ai_family = (af == PR_AF_INET) ? AF_INET : AF_UNSPEC;
/*
* it is important to select a socket type in the hints, otherwise we