фикс: зависания соединения с протоколом http
This commit is contained in:
parent
3714207983
commit
b2ed7ab015
@ -50,9 +50,7 @@ namespace http::server {
|
|||||||
|
|
||||||
void Connection::doWrite() {
|
void Connection::doWrite() {
|
||||||
reply_.headers.push_back({.name = "Server", .value = SERVER_HEADER_VALUE});
|
reply_.headers.push_back({.name = "Server", .value = SERVER_HEADER_VALUE});
|
||||||
if (!reply_.content.empty()) {
|
reply_.headers.push_back({.name = "Content-Length", .value = std::to_string(reply_.content.size())});
|
||||||
reply_.headers.push_back({.name = "Content-Length", .value = std::to_string(reply_.content.size())});
|
|
||||||
}
|
|
||||||
if (request_.http_version_major == 1) {
|
if (request_.http_version_major == 1) {
|
||||||
reply_.headers.push_back({.name = "Connection", .value = "keep-alive"});
|
reply_.headers.push_back({.name = "Connection", .value = "keep-alive"});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user