Commit db73430c by xiongziliang

修复Keep-Alive的bug

parent e8e35dcf
...@@ -389,9 +389,10 @@ inline HttpSession::KeyValue HttpSession::makeHttpHeader(bool bClose, int64_t iC ...@@ -389,9 +389,10 @@ inline HttpSession::KeyValue HttpSession::makeHttpHeader(bool bClose, int64_t iC
static uint32_t reqCnt = mINI::Instance()[Config::Http::kMaxReqCount].as<uint32_t>(); static uint32_t reqCnt = mINI::Instance()[Config::Http::kMaxReqCount].as<uint32_t>();
headerOut.emplace("Server", serverName); headerOut.emplace("Server", serverName);
headerOut.emplace("Connection", bClose ? "close" : headerOut.emplace("Connection", bClose ? "close" : "keep-alive");
StrPrinter << "keep-alive: timeout=" << keepAliveSec if(!bClose){
<< ", max=" << reqCnt << endl); headerOut.emplace("Keep-Alive",StrPrinter << "timeout=" << keepAliveSec << ", max=" << reqCnt << endl);
}
headerOut.emplace("Date", dateStr()); headerOut.emplace("Date", dateStr());
if(iContentSize >=0 && pcContentType !=nullptr){ if(iContentSize >=0 && pcContentType !=nullptr){
auto strContentType = StrPrinter << pcContentType << "; charset=" << charSet << endl; auto strContentType = StrPrinter << pcContentType << "; charset=" << charSet << endl;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论