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

@@ -30,6 +30,15 @@ struct HTTPCallback {
*/
virtual void OnReceiveData(const char *data, size_t length) = 0;
/**
* Check if there is a request to cancel the transfer.
*
* @return true iff the connection is cancelled.
* @note Cancellations are never instant, and can take a bit of time to be processed.
* The object needs to remain valid until the OnFailure() callback is called.
*/
virtual bool IsCancelled() const = 0;
/** Silentium */
virtual ~HTTPCallback() {}
};