spdyd: Open file with O_BINARY flag

This commit is contained in:
Tatsuhiro Tsujikawa 2012-10-16 22:57:26 +09:00
parent 22840dbfaf
commit fdc19550fc
1 changed files with 5 additions and 1 deletions

View File

@ -44,6 +44,10 @@
#include "util.h" #include "util.h"
#include "EventPoll.h" #include "EventPoll.h"
#ifndef O_BINARY
# define O_BINARY (0)
#endif // O_BINARY
namespace spdylay { namespace spdylay {
namespace { namespace {
@ -510,7 +514,7 @@ void prepare_response(Request *req, SpdyEventHandler *hd)
if(path[path.size()-1] == '/') { if(path[path.size()-1] == '/') {
path += DEFAULT_HTML; path += DEFAULT_HTML;
} }
int file = open(path.c_str(), O_RDONLY); int file = open(path.c_str(), O_RDONLY | O_BINARY);
if(file == -1) { if(file == -1) {
prepare_status_response(req, hd, STATUS_404); prepare_status_response(req, hd, STATUS_404);
} else { } else {