summaryrefslogtreecommitdiffstats
path: root/server/listen.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/listen.c')
-rw-r--r--server/listen.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/listen.c b/server/listen.c
index 14624d6dac..5e73cc5090 100644
--- a/server/listen.c
+++ b/server/listen.c
@@ -78,11 +78,20 @@ static int make_sock(const struct sockaddr_in *server)
else
ap_snprintf(addr, sizeof(addr), "port %d", ntohs(server->sin_port));
+#ifdef WIN32
+ s = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, WSA_FLAG_OVERLAPPED);
+ if (s == INVALID_SOCKET) {
+ ap_log_error(APLOG_MARK, APLOG_CRIT, NULL,
+ "make_sock: failed to get a socket for %s", addr);
+ return -1;
+ }
+#else
if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
ap_log_error(APLOG_MARK, APLOG_CRIT, NULL,
"make_sock: failed to get a socket for %s", addr);
return -1;
}
+#endif
#ifdef SO_REUSEADDR
if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof(int)) < 0) {