mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
NET: Merge change_connection into cancel_download
This commit is contained in:
parent
33625ae9e2
commit
637f1e82e6
@ -978,15 +978,17 @@ load_uri(struct uri *uri, struct uri *referrer, struct download *download,
|
||||
|
||||
|
||||
/* FIXME: one object in more connections */
|
||||
static void
|
||||
change_connection(struct download *old, struct download *new,
|
||||
enum connection_priority newpri, int interrupt)
|
||||
void
|
||||
cancel_download(struct download *old, int interrupt)
|
||||
{
|
||||
struct connection *conn;
|
||||
|
||||
assert(old);
|
||||
if_assert_failed return;
|
||||
|
||||
if (is_in_result_state(old->state))
|
||||
return;
|
||||
|
||||
check_queue_bugs();
|
||||
|
||||
conn = old->conn;
|
||||
@ -1012,15 +1014,6 @@ change_connection(struct download *old, struct download *new,
|
||||
register_check_queue();
|
||||
}
|
||||
|
||||
void
|
||||
cancel_download(struct download *download, int interrupt)
|
||||
{
|
||||
if (is_in_result_state(download->state))
|
||||
return;
|
||||
|
||||
change_connection(download, NULL, PRI_CANCEL, interrupt);
|
||||
}
|
||||
|
||||
void
|
||||
move_download(struct download *old, struct download *new,
|
||||
enum connection_priority newpri)
|
||||
@ -1043,7 +1036,7 @@ move_download(struct download *old, struct download *new,
|
||||
conn->pri[new->pri]++;
|
||||
add_to_list(conn->downloads, new);
|
||||
|
||||
change_connection(old, new, newpri, 0);
|
||||
cancel_download(old, 0);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user