summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-03 15:24:39 +0000
committerrubidium <rubidium@openttd.org>2009-04-03 15:24:39 +0000
commit2bfc9ca50ccaa0056a6ab4b7e89c1065e6d93d9f (patch)
tree70fd468ed86e826369f2e3639e5cef3ab864a207
parent65d10e66f004de45a86eb9909171a65f448d227f (diff)
downloadopenttd-2bfc9ca50ccaa0056a6ab4b7e89c1065e6d93d9f.tar.xz
(svn r15934) -Fix: work around Solaris' inability to "parse" 0 as defined in the specifications.
-rw-r--r--src/network/core/address.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp
index 016489001..5a79a436e 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;
}