summaryrefslogtreecommitdiff
path: root/lib/server
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-04-22 20:48:18 +0000
committerChris Wilson <chris+github@qwirx.com>2007-04-22 20:48:18 +0000
commite94c3e5e551271ebdb98f444850de873dc4837f0 (patch)
treece1808e1419d77f4ee1c77af818f35c3a39e9615 /lib/server
parenta6a6ca0bb3bae5ba252f3593e418a496377798ed (diff)
Ignore attempts to listen on a Unix socket on Win32, so that we can share
config files for the unit tests (refs #3)
Diffstat (limited to 'lib/server')
-rw-r--r--lib/server/ServerStream.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/lib/server/ServerStream.h b/lib/server/ServerStream.h
index d5abccdd..f8578a04 100644
--- a/lib/server/ServerStream.h
+++ b/lib/server/ServerStream.h
@@ -170,16 +170,22 @@ public:
}
else if(c[0] == "unix")
{
- // Check arguments size
- if(c.size() != 2)
- {
- THROW_EXCEPTION(ServerException, ServerStreamBadListenAddrs)
- }
+ #ifdef WIN32
+ BOX_WARNING("Ignoring request to listen on a Unix socket on Windows: " << addrlist[a]);
+ delete psocket;
+ psocket = NULL;
+ #else
+ // Check arguments size
+ if(c.size() != 2)
+ {
+ THROW_EXCEPTION(ServerException, ServerStreamBadListenAddrs)
+ }
- // unlink anything there
- ::unlink(c[1].c_str());
-
- psocket->Listen(Socket::TypeUNIX, c[1].c_str());
+ // unlink anything there
+ ::unlink(c[1].c_str());
+
+ psocket->Listen(Socket::TypeUNIX, c[1].c_str());
+ #endif // WIN32
}
else
{
@@ -187,8 +193,11 @@ public:
THROW_EXCEPTION(ServerException, ServerStreamBadListenAddrs)
}
- // Add to list of sockets
- mSockets.push_back(psocket);
+ if (psocket != NULL)
+ {
+ // Add to list of sockets
+ mSockets.push_back(psocket);
+ }
}
catch(...)
{
@@ -196,8 +205,11 @@ public:
throw;
}
- // Add to the list of things to wait on
- connectionWait.Add(psocket);
+ if (psocket != NULL)
+ {
+ // Add to the list of things to wait on
+ connectionWait.Add(psocket);
+ }
}
}