2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-27 06:32:08 +00:00

In getaddrinfo emulation, only check the socket type (SOCK_STREAM or SOCK_DGRAM)

if a service name has been specified. This should allow the emulation to work
with raw sockets.


[SVN r58650]
This commit is contained in:
Christopher Kohlhoff
2010-01-02 21:35:33 +00:00
parent c2f12c99e0
commit 51b0750d54

View File

@@ -1388,8 +1388,9 @@ inline int gai_echeck(const char* host, const char* service,
break;
case AF_INET:
case AF_INET6:
if (socktype != 0 && socktype != SOCK_STREAM && socktype != SOCK_DGRAM)
return EAI_SOCKTYPE;
if (service != 0 && service[0] != '\0')
if (socktype != 0 && socktype != SOCK_STREAM && socktype != SOCK_DGRAM)
return EAI_SOCKTYPE;
break;
default:
return EAI_FAMILY;