mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
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:
parent
02c5bde5a9
commit
4c256408c5
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user