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:
parent
ec7e0dc0f6
commit
9c5c8385fc
1 changed files with 4 additions and 0 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue