fix sendfile bug
This commit is contained in:
parent
6adc6ce9a6
commit
34a63b7962
|
@ -557,11 +557,9 @@ void HttpAppFrameworkImpl::readSendFile(const std::string& filePath,const HttpRe
|
|||
std::streambuf * pbuf = infile.rdbuf();
|
||||
std::streamsize size = pbuf->pubseekoff(0,infile.end);
|
||||
pbuf->pubseekoff(0,infile.beg); // rewind
|
||||
|
||||
std::string str;
|
||||
str.reserve(size);
|
||||
pbuf->sgetn (&str[0],size);
|
||||
str.resize(size);
|
||||
pbuf->sgetn (&str[0],size);
|
||||
infile.close();
|
||||
|
||||
resp->setStatusCode(HttpResponse::k200Ok);
|
||||
|
|
Loading…
Reference in New Issue