fetch: Bump last_msg rather than always assigning it

If we are aborting a cURL fetch then it's possible entry to
cURL to clean up could cause a PROGRESS message to happen which
we need to not reset last_msg for, otherwise we spuriously attempt
to send an ERROR message during abort which is not a safe time for
our message callback to be used.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-02-24 17:43:21 +00:00
parent 02c5bde5a9
commit 4c256408c5
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74

View File

@ -804,7 +804,9 @@ fetch_multipart_data_new_kv(struct fetch_multipart_data **list,
void void
fetch_send_callback(const fetch_msg *msg, struct fetch *fetch) fetch_send_callback(const fetch_msg *msg, struct fetch *fetch)
{ {
fetch->last_msg = msg->type; /* Bump the last_msg to the greatest seen msg */
if (msg->type > fetch->last_msg)
fetch->last_msg = msg->type;
fetch->callback(msg, fetch->p); fetch->callback(msg, fetch->p);
} }