Re #2071: Specify socktype hint when calling getaddrinfo, to reduce the number of addresses returned.
Thanks to Alexander Traud for the patch. git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5707 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
e25c665c69
commit
a39e60661e
|
@ -178,6 +178,7 @@ PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename,
|
||||||
/* Call getaddrinfo() */
|
/* Call getaddrinfo() */
|
||||||
pj_bzero(&hint, sizeof(hint));
|
pj_bzero(&hint, sizeof(hint));
|
||||||
hint.ai_family = af;
|
hint.ai_family = af;
|
||||||
|
hint.ai_socktype = pj_SOCK_DGRAM() | pj_SOCK_STREAM();
|
||||||
|
|
||||||
rc = getaddrinfo(nodecopy, NULL, &hint, &res);
|
rc = getaddrinfo(nodecopy, NULL, &hint, &res);
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
|
|
Loading…
Reference in New Issue