summaryrefslogtreecommitdiff
path: root/methods/basehttp.h
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-08-11 10:55:09 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2020-08-11 13:09:04 +0200
commit73780d7f664a4ea1da55527d726b4c9c7753f1fb (patch)
tree5ecda7381fd1153dd095a1a6fa282095dcf92b08 /methods/basehttp.h
parent13ab2317451931f055855f1aeaec6c8b28b14ce2 (diff)
http: Fully flush local file both before/after server read
We do not want to end up in a code path while reading content from the server where we have local data left to write, which can happen if a previous read included both headers and content. Restructure Flush() to accept a new argument to allow incomplete flushs (which do not match our limit), so that it can flush as far as possible, and modify Go() and use that before and after reading from the server.
Diffstat (limited to 'methods/basehttp.h')
-rw-r--r--methods/basehttp.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/methods/basehttp.h b/methods/basehttp.h
index 5fdff69e0..4a83f319c 100644
--- a/methods/basehttp.h
+++ b/methods/basehttp.h
@@ -107,7 +107,7 @@ struct ServerState
virtual bool Close() = 0;
virtual bool InitHashes(HashStringList const &ExpectedHashes) = 0;
virtual ResultState Die(RequestState &Req) = 0;
- virtual bool Flush(FileFd * const File) = 0;
+ virtual bool Flush(FileFd *const File, bool MustComplete = false) = 0;
virtual ResultState Go(bool ToFile, RequestState &Req) = 0;
virtual Hashes * GetHashes() = 0;