Questionable: support ancient Http and connection: close

This commit is contained in:
Alex Hultman
2021-01-11 13:13:06 +01:00
parent 1acbcaf03a
commit 3347bcc4b2
3 changed files with 32 additions and 1 deletions
+8
View File
@@ -45,12 +45,17 @@ private:
struct Header {
std::string_view key, value;
} headers[MAX_HEADERS];
bool ancientHttp;
unsigned int querySeparator;
bool didYield;
BloomFilter bf;
std::pair<int, std::string_view *> currentParameters;
public:
bool isAncient() {
return ancientHttp;
}
bool getYield() {
return didYield;
}
@@ -226,6 +231,9 @@ private:
length -= consumed;
consumedTotal += consumed;
/* Store HTTP version (ancient 1.0 or 1.1) */
req->ancientHttp = req->headers->value.length() && (req->headers->value[req->headers->value.length() - 1] == '0');
/* Strip away tail of first "header value" aka URL */
req->headers->value = std::string_view(req->headers->value.data(), (size_t) std::max<int>(0, (int) req->headers->value.length() - 9));