summaryrefslogtreecommitdiff
path: root/methods/http.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/http.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/http.h')
-rw-r--r--methods/http.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/methods/http.h b/methods/http.h
index 5668f0b87..cae579afe 100644
--- a/methods/http.h
+++ b/methods/http.h
@@ -114,7 +114,7 @@ struct HttpServerState: public ServerState
virtual bool InitHashes(HashStringList const &ExpectedHashes) APT_OVERRIDE;
virtual Hashes * GetHashes() APT_OVERRIDE;
virtual ResultState Die(RequestState &Req) APT_OVERRIDE;
- virtual bool Flush(FileFd * const File) APT_OVERRIDE;
+ virtual bool Flush(FileFd *const File, bool MustComplete = true) APT_OVERRIDE;
virtual ResultState Go(bool ToFile, RequestState &Req) APT_OVERRIDE;
HttpServerState(URI Srv, HttpMethod *Owner);