From 4c256408c5b21d20bf703571ba106f7bb6101ada Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Mon, 24 Feb 2020 17:43:21 +0000 Subject: 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 --- content/fetch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/fetch.c b/content/fetch.c index 331b5f430..807e811c4 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -804,7 +804,9 @@ fetch_multipart_data_new_kv(struct fetch_multipart_data **list, void 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); } -- cgit v1.2.3