Fixed compiler warnings on Windows.
This commit is contained in:
parent
2915a80a5f
commit
cb19368e14
2 changed files with 15 additions and 12 deletions
|
@ -151,14 +151,14 @@ handshake_00(struct libwebsocket_context *context, struct libwebsocket *wsi)
|
|||
|
||||
/* lay them out in network byte order (MSB first */
|
||||
|
||||
sum[0] = key1 >> 24;
|
||||
sum[1] = key1 >> 16;
|
||||
sum[2] = key1 >> 8;
|
||||
sum[3] = key1;
|
||||
sum[4] = key2 >> 24;
|
||||
sum[5] = key2 >> 16;
|
||||
sum[6] = key2 >> 8;
|
||||
sum[7] = key2;
|
||||
sum[0] = (unsigned char)(key1 >> 24);
|
||||
sum[1] = (unsigned char)(key1 >> 16);
|
||||
sum[2] = (unsigned char)(key1 >> 8);
|
||||
sum[3] = (unsigned char)(key1);
|
||||
sum[4] = (unsigned char)(key2 >> 24);
|
||||
sum[5] = (unsigned char)(key2 >> 16);
|
||||
sum[6] = (unsigned char)(key2 >> 8);
|
||||
sum[7] = (unsigned char)(key2);
|
||||
|
||||
/* follow them with the challenge token we were sent */
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#include "private-libwebsockets.h"
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#include <tchar.h>
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <ifaddrs.h>
|
||||
#include <sys/un.h>
|
||||
|
@ -444,7 +445,9 @@ libwebsockets_get_peer_addresses(int fd, char *name, int name_len,
|
|||
char ip[128];
|
||||
unsigned char *p;
|
||||
int n;
|
||||
struct sockaddr_un *un;
|
||||
#ifdef AF_LOCAL
|
||||
struct sockaddr_un *un;
|
||||
#endif
|
||||
|
||||
rip[0] = '\0';
|
||||
name[0] = '\0';
|
||||
|
@ -948,7 +951,7 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context,
|
|||
p += strlen(wsi->key_b64);
|
||||
p += sprintf(p, "\x0d\x0a");
|
||||
if (wsi->c_origin)
|
||||
p += sprintf(p, "Sec-WebSocket-Origin: %s\x0d\x0a",
|
||||
p += sprintf(p, "Sec-WebSocket-Origin: %s\x0d\x0a",
|
||||
wsi->c_origin);
|
||||
if (wsi->c_protocol)
|
||||
p += sprintf(p, "Sec-WebSocket-Protocol: %s\x0d\x0a",
|
||||
|
@ -2557,7 +2560,7 @@ libwebsocket_create_context(int port, const char *interf,
|
|||
poll = emulated_poll;
|
||||
|
||||
/* if windows socket lib available, use his WSAPoll */
|
||||
wsdll = GetModuleHandle("Ws2_32.dll");
|
||||
wsdll = GetModuleHandle(_T("Ws2_32.dll"));
|
||||
if (wsdll)
|
||||
poll = (PFNWSAPOLL)GetProcAddress(wsdll, "WSAPoll");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue