summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-02-24 17:43:21 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-02-24 17:43:21 +0000
commit4c256408c5b21d20bf703571ba106f7bb6101ada (patch)
tree214ce6c2dd2ff9dc6832c3d10f887ff8cfae2c50
parent02c5bde5a9f8a931ddeff425154bf63ebd82fce3 (diff)
downloadnetsurf-4c256408c5b21d20bf703571ba106f7bb6101ada.tar.gz
netsurf-4c256408c5b21d20bf703571ba106f7bb6101ada.tar.bz2
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>
-rw-r--r--content/fetch.c4
1 files changed, 3 insertions, 1 deletions
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);
}