Fix #10131: actually cancel downloads when pressing cancel

This commit is contained in:
Patric Stout
2023-02-15 20:54:08 +01:00
committed by Patric Stout
parent dea2dea881
commit fdfcb09aa3
5 changed files with 56 additions and 17 deletions

View File

@@ -76,6 +76,7 @@ protected:
FILE *curFile; ///< Currently downloaded file
ContentInfo *curInfo; ///< Information about the currently downloaded file
bool isConnecting; ///< Whether we're connecting
bool isCancelled; ///< Whether the download has been cancelled
std::chrono::steady_clock::time_point lastActivity; ///< The last time there was network activity
friend class NetworkContentConnecter;
@@ -94,6 +95,7 @@ protected:
void OnFailure() override;
void OnReceiveData(const char *data, size_t length) override;
bool IsCancelled() const override;
bool BeforeDownload();
void AfterDownload();