From f19bbc73cccd73809ae4edb2422b30a429939531 Mon Sep 17 00:00:00 2001 From: Doug Rogers Date: Thu, 29 Jan 2015 00:12:35 -0500 Subject: [PATCH] Allow for compilation in Visual Studio 9 (2008) with NS_ENABLE_IPV6. --- mongoose.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mongoose.c b/mongoose.c index 0cacdfed..a388a426 100644 --- a/mongoose.c +++ b/mongoose.c @@ -79,6 +79,7 @@ #ifdef _MSC_VER #pragma comment(lib, "ws2_32.lib") // Linking with winsock library #endif +#include #include #include #ifndef EINPROGRESS @@ -2961,9 +2962,9 @@ size_t mg_websocket_write(struct mg_connection *conn, int opcode, copy_len = 4 + data_len; } else { // 64-bit length field - copy[1] = 127; const uint32_t hi = htonl((uint32_t) ((uint64_t) data_len >> 32)); const uint32_t lo = htonl(data_len & 0xffffffff); + copy[1] = 127; memcpy(copy+2,&hi,sizeof(hi)); memcpy(copy+6,&lo,sizeof(lo)); memcpy(copy + 10, data, data_len);