From 4f01f101fc533fa1c87d5bd1cca48218d7f194c6 Mon Sep 17 00:00:00 2001 From: Igor Okulist Date: Sat, 15 Sep 2012 20:40:28 -0700 Subject: [PATCH] Compile on Win32 --- mongoose.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mongoose.c b/mongoose.c index 90bfdf6b..17b48f71 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1507,7 +1507,7 @@ int mg_printf(struct mg_connection *conn, const char *fmt, ...) { // vsnprintf() error, give up len = -1; cry(conn, "%s(%s, ...): vsnprintf() error", __func__, fmt); - } else if (len > (int) sizeof(mem) && (buf = malloc(len + 1)) != NULL) { + } else if (len > (int) sizeof(mem) && (buf = (char *) malloc(len + 1)) != NULL) { // Local buffer is not large enough, allocate big buffer on heap va_start(ap, fmt); vsnprintf(buf, len + 1, fmt, ap); @@ -3630,7 +3630,7 @@ static int set_ports_option(struct mg_context *ctx) { // handshake will figure out that the client is down and // will close the server end. // Thanks to Igor Klopov who suggested the patch. - setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (void *) &on, + setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (char *) &on, sizeof(on)) != 0 || bind(sock, &so.lsa.sa, sizeof(so.lsa)) != 0 || listen(sock, SOMAXCONN) != 0) { @@ -3949,7 +3949,7 @@ static void close_socket_gracefully(struct mg_connection *conn) { // ephemeral port exhaust problem under high QPS. linger.l_onoff = 1; linger.l_linger = 1; - setsockopt(sock, SOL_SOCKET, SO_LINGER, (void *) &linger, sizeof(linger)); + setsockopt(sock, SOL_SOCKET, SO_LINGER, (char *) &linger, sizeof(linger)); // Send FIN to the client (void) shutdown(sock, SHUT_WR);