mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 13:24:43 -04:00
Use the common-case code from getaddrinfo_common *always*; OS differences are just too huge.
svn:r1541
This commit is contained in:
parent
3451c870da
commit
9151d000e6
22
evutil.c
22
evutil.c
@ -843,7 +843,8 @@ evutil_getaddrinfo(const char *nodename, const char *servname,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef AI_NUMERICSERV
|
#if 0
|
||||||
|
/* XXXX This is now done by the call below. */
|
||||||
/* Not every system has AI_NUMERICSERV, so fake it. */
|
/* Not every system has AI_NUMERICSERV, so fake it. */
|
||||||
if (hints.ai_flags & EVUTIL_AI_NUMERICSERV) {
|
if (hints.ai_flags & EVUTIL_AI_NUMERICSERV) {
|
||||||
if (evutil_parse_servname(servname,
|
if (evutil_parse_servname(servname,
|
||||||
@ -852,17 +853,26 @@ evutil_getaddrinfo(const char *nodename, const char *servname,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
/* Enough operating systems handle enough common non-resolve
|
||||||
/* Windows handles enough cases here weirdly enough that we
|
* cases here weirdly enough that we are better off just
|
||||||
* are better off just overriding a bunch of them. */
|
* overriding them. For example:
|
||||||
|
* - Some believe that giving a numeric port as a servname is
|
||||||
|
* totally verboten. (I think this includes OpenBSD IIUC).
|
||||||
|
* [XXXX we don't fix this case completely.]
|
||||||
|
* - Windows is eccentric.
|
||||||
|
*/
|
||||||
{
|
{
|
||||||
int err, port;
|
int err, port;
|
||||||
err = evutil_getaddrinfo_common(nodename,servname,&hints,
|
err = evutil_getaddrinfo_common(nodename,servname,&hints,
|
||||||
res, &port);
|
res, &port);
|
||||||
if (err != EVUTIL_EAI_NEED_RESOLVE)
|
if (err == 0 ||
|
||||||
|
err == EVUTIL_EAI_MEMORY ||
|
||||||
|
err == EVUTIL_EAI_NONAME)
|
||||||
return err;
|
return err;
|
||||||
|
/* If we make it here, the system getaddrinfo can
|
||||||
|
* have a crack at it. */
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure that we didn't actually steal any AI_FLAGS values that
|
/* Make sure that we didn't actually steal any AI_FLAGS values that
|
||||||
|
Loading…
x
Reference in New Issue
Block a user