From fdc19550fcae3d1b125c5c3080b12a2d6bc83bb6 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 16 Oct 2012 22:57:26 +0900 Subject: [PATCH] spdyd: Open file with O_BINARY flag --- src/SpdyServer.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SpdyServer.cc b/src/SpdyServer.cc index 46d5779b..21fb423c 100644 --- a/src/SpdyServer.cc +++ b/src/SpdyServer.cc @@ -44,6 +44,10 @@ #include "util.h" #include "EventPoll.h" +#ifndef O_BINARY +# define O_BINARY (0) +#endif // O_BINARY + namespace spdylay { namespace { @@ -510,7 +514,7 @@ void prepare_response(Request *req, SpdyEventHandler *hd) if(path[path.size()-1] == '/') { path += DEFAULT_HTML; } - int file = open(path.c_str(), O_RDONLY); + int file = open(path.c_str(), O_RDONLY | O_BINARY); if(file == -1) { prepare_status_response(req, hd, STATUS_404); } else {