mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 22:55:52 +08:00
修复Keep-Alive的bug
This commit is contained in:
parent
e8e35dcfe4
commit
db73430c54
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user