From 627163b7856a9fbd595810d1f031674bbb004f04 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 3 Apr 2009 15:24:39 +0000 Subject: [PATCH] (svn r15934) -Fix: work around Solaris' inability to "parse" 0 as defined in the specifications. --- src/network/core/address.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp index 016489001d..5a79a436e4 100644 --- a/src/network/core/address.cpp +++ b/src/network/core/address.cpp @@ -69,7 +69,14 @@ static SOCKET ResolveLoopProc(addrinfo *runp) const sockaddr_storage *NetworkAddress::GetAddress() { - if (!this->IsResolved()) this->Resolve(this->address.ss_family, 0, AI_ADDRCONFIG, ResolveLoopProc); + if (!this->IsResolved()) { + /* Here we try to resolve a network address. We use SOCK_STREAM as + * socket type because some stupid OSes, like Solaris, cannot be + * bothered to implement the specifications and allow '0' as value + * that means "don't care whether it is SOCK_STREAM or SOCK_DGRAM". + */ + this->Resolve(this->address.ss_family, SOCK_STREAM, AI_ADDRCONFIG, ResolveLoopProc); + } return &this->address; }