Minor fix
This commit is contained in:
parent
10cb404519
commit
9a9f3a3e18
@ -10,8 +10,6 @@
|
|||||||
#include <code/seafire/protocol/rfc7231/date.hxx>
|
#include <code/seafire/protocol/rfc7231/date.hxx>
|
||||||
#include <code/seafire/protocol/rfc7231/server.hxx>
|
#include <code/seafire/protocol/rfc7231/server.hxx>
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
|
|
||||||
namespace code::seafire::server
|
namespace code::seafire::server
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -196,17 +194,22 @@ namespace code::seafire::server
|
|||||||
auto c = get<protocol::rfc7230::connection_t>(get_request());
|
auto c = get<protocol::rfc7230::connection_t>(get_request());
|
||||||
|
|
||||||
if (c && c->close()) {
|
if (c && c->close()) {
|
||||||
|
trace() << "close requested by request!";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_request().version() == protocol::http_1_0 && c) {
|
if (get_request().version() == protocol::http_1_0 && c) {
|
||||||
|
trace() << "close requested by protocol version";
|
||||||
return c->keep_alive();
|
return c->keep_alive();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_request().version() == protocol::http_1_1) {
|
if (get_request().version() == protocol::http_1_1) {
|
||||||
|
trace() << "keep-live requested by protocol version";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trace() << "defaulting to close";
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,8 +292,6 @@ namespace code::seafire::server
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle Expect: 100-continue
|
|
||||||
|
|
||||||
if (auto expect = request_.headers().get_one("expect"); expect) {
|
if (auto expect = request_.headers().get_one("expect"); expect) {
|
||||||
if (request_.version() == protocol::http_1_1 && *expect == "100-continue") {
|
if (request_.version() == protocol::http_1_1 && *expect == "100-continue") {
|
||||||
static std::string const response{
|
static std::string const response{
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include <asio.hpp>
|
#include <asio.hpp>
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user