Commit f2b0b9c7 authored by Sergey Lyubka's avatar Sergey Lyubka

Fix Win32 build in mg_websocket_write()

parent b3866439
...@@ -2998,9 +2998,9 @@ size_t mg_websocket_write(struct mg_connection *conn, int opcode, ...@@ -2998,9 +2998,9 @@ size_t mg_websocket_write(struct mg_connection *conn, int opcode,
copy_len = 4 + data_len; copy_len = 4 + data_len;
} else { } else {
// 64-bit length field // 64-bit length field
copy[1] = 127;
const uint32_t hi = htonl((uint32_t) ((uint64_t) data_len >> 32)); const uint32_t hi = htonl((uint32_t) ((uint64_t) data_len >> 32));
const uint32_t lo = htonl(data_len & 0xffffffff); const uint32_t lo = htonl(data_len & 0xffffffff);
copy[1] = 127;
memcpy(copy+2,&hi,sizeof(hi)); memcpy(copy+2,&hi,sizeof(hi));
memcpy(copy+6,&lo,sizeof(lo)); memcpy(copy+6,&lo,sizeof(lo));
memcpy(copy + 10, data, data_len); memcpy(copy + 10, data, data_len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment