From 73780d7f664a4ea1da55527d726b4c9c7753f1fb Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2020 10:55:09 +0200 Subject: 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. --- methods/basehttp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'methods/basehttp.h') 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; -- cgit v1.2.3-70-g09d2