From e8c00aa47e86f7212acac97a1c65c6666d27cc8d Mon Sep 17 00:00:00 2001 From: Michel Archambault Date: Thu, 14 Mar 2013 11:45:49 -0400 Subject: [PATCH] Fixed read of the jpg in Windows Windows needs to open things with _O_BINARY Signed-off-by: Michel Archambault --- test-server/test-server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test-server/test-server.c b/test-server/test-server.c index 6af7a998..ad2e9cd0 100644 --- a/test-server/test-server.c +++ b/test-server/test-server.c @@ -142,7 +142,12 @@ static int callback_http(struct libwebsocket_context *context, p = buffer; +#ifdef WIN32 + pss->fd = open(LOCAL_RESOURCE_PATH"/leaf.jpg", O_RDONLY | _O_BINARY); +#else pss->fd = open(LOCAL_RESOURCE_PATH"/leaf.jpg", O_RDONLY); +#endif + if (pss->fd < 0) return -1;