mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
1008: always erase timer ID in upload_stat_timer()
This commit is contained in:
parent
08941fd47d
commit
8e33098306
@ -327,9 +327,9 @@ update_connection_progress(struct connection *conn)
|
|||||||
update_progress(conn->progress, conn->received, conn->est_length, conn->from);
|
update_progress(conn->progress, conn->received, conn->est_length, conn->from);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Progress timer callback for @conn->progress. As explained in
|
/** Progress timer callback for @a conn->progress. As explained in
|
||||||
* @start_update_progress, this function must erase the expired timer
|
* start_update_progress(), this function must erase the expired timer
|
||||||
* ID from @conn->progress->timer. */
|
* ID from @a conn->progress->timer. */
|
||||||
static void
|
static void
|
||||||
stat_timer(struct connection *conn)
|
stat_timer(struct connection *conn)
|
||||||
{
|
{
|
||||||
@ -338,16 +338,26 @@ stat_timer(struct connection *conn)
|
|||||||
notify_connection_callbacks(conn);
|
notify_connection_callbacks(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Progress timer callback for @a conn->upload_progress. As explained
|
||||||
|
* in start_update_progress(), this function must erase the expired timer
|
||||||
|
* ID from @a conn->upload_progress->timer. */
|
||||||
static void
|
static void
|
||||||
upload_stat_timer(struct connection *conn)
|
upload_stat_timer(struct connection *conn)
|
||||||
{
|
{
|
||||||
struct http_connection_info *http = conn->info;
|
struct http_connection_info *http = conn->info;
|
||||||
|
|
||||||
assert(conn->http_upload_progress && http);
|
assert(conn->http_upload_progress);
|
||||||
if_assert_failed return;
|
if_assert_failed return;
|
||||||
|
assert(http);
|
||||||
|
if_assert_failed {
|
||||||
|
conn->http_upload_progress->timer = TIMER_ID_UNDEF;
|
||||||
|
/* The expired timer ID has now been erased. */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
update_progress(conn->http_upload_progress, http->post.uploaded,
|
update_progress(conn->http_upload_progress, http->post.uploaded,
|
||||||
http->post.total_upload_length, http->post.uploaded);
|
http->post.total_upload_length, http->post.uploaded);
|
||||||
|
/* The expired timer ID has now been erased. */
|
||||||
notify_connection_callbacks(conn);
|
notify_connection_callbacks(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user