fetch: When aborting, ensure we note this to not multi-fail

When aborting a fetch, it may be cleaned up, in which case we
would otherwise send a spurious failure message too early. Instead
we record that the abort has occurred to suppress such an error.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-02-24 10:24:23 +00:00
parent 5cfe0dfffc
commit 97870122dd
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74
2 changed files with 7 additions and 0 deletions

View File

@ -585,6 +585,7 @@ fetch_start(nsurl *url,
void fetch_abort(struct fetch *f)
{
assert(f);
f->last_msg = FETCH__INTERNAL_ABORTED;
NSLOG(fetch, DEBUG,
"fetch %p, fetcher %p, url '%s'", f, f->fetcher_handle,
nsurl_access(f->url));

View File

@ -60,6 +60,12 @@ typedef enum {
*/
#define FETCH_MIN_FINISHED_MSG FETCH_FINISHED
/**
* This message is actually an internal message used to indicate
* that a fetch was aborted. Do not send this, nor expect it.
*/
#define FETCH__INTERNAL_ABORTED FETCH_ERROR
/**
* Fetcher message data
*/