summaryrefslogtreecommitdiff
path: root/methods/basehttp.h
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2021-07-01 15:35:21 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2021-07-01 15:35:21 +0200
commitf9e2e914996ce8f0af33d5bfed52e814e0f4a861 (patch)
tree58348187c870592a4a4725a24a74778793905683 /methods/basehttp.h
parent690f6191a4332123a912c812a19a37cef253e90c (diff)
basehttp: Turn HaveContent into a TriState
We need to be able to set HaveContent to false if the Content-Length is 0, and not have that overriden just because a later header is Content-Type.
Diffstat (limited to 'methods/basehttp.h')
-rw-r--r--methods/basehttp.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/methods/basehttp.h b/methods/basehttp.h
index c0d14d854..2a13c7abf 100644
--- a/methods/basehttp.h
+++ b/methods/basehttp.h
@@ -27,6 +27,12 @@ class Hashes;
class BaseHttpMethod;
struct ServerState;
+enum class HaveContent
+{
+ UNKNOWN,
+ FALSE,
+ TRUE,
+};
struct RequestState
{
unsigned int Major = 0;
@@ -46,7 +52,8 @@ struct RequestState
unsigned long long MaximumSize = 0;
time_t Date;
- bool HaveContent = false;
+ HaveContent haveContent = HaveContent::UNKNOWN;
+
enum {Chunked,Stream,Closes} Encoding = Closes;
enum {Header, Data} State = Header;
std::string Location;