1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

win32 use binary flag on opening http file

Reported-by: Michel Archambault <marchamb@matrox.com>
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
Andy Green 2011-05-14 15:08:00 +02:00
parent ec7e0dc0f6
commit 9c5c8385fc

View file

@ -1670,7 +1670,11 @@ int libwebsockets_serve_http_file(struct libwebsocket *wsi, const char *file,
char *p = buf;
int n;
#ifdef WIN32
fd = open(file, O_RDONLY | _O_BINARY);
#else
fd = open(file, O_RDONLY);
#endif
if (fd < 1) {
p += sprintf(p, "HTTP/1.0 400 Bad\x0d\x0a"
"Server: libwebsockets\x0d\x0a"