mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
NET: Move shortcut from change_connection to the two front-ends
This commit is contained in:
parent
500de86927
commit
8b938cb7a6
@ -987,14 +987,6 @@ change_connection(struct download *old, struct download *new,
|
||||
assert(old);
|
||||
if_assert_failed return;
|
||||
|
||||
if (is_in_result_state(old->state)) {
|
||||
if (new) {
|
||||
if (new->callback)
|
||||
new->callback(new, new->data);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
check_queue_bugs();
|
||||
|
||||
conn = old->conn;
|
||||
@ -1023,6 +1015,9 @@ change_connection(struct download *old, struct download *new,
|
||||
void
|
||||
cancel_download(struct download *download, int interrupt)
|
||||
{
|
||||
if (is_in_result_state(download->state))
|
||||
return;
|
||||
|
||||
change_connection(download, NULL, PRI_CANCEL, interrupt);
|
||||
}
|
||||
|
||||
@ -1039,6 +1034,12 @@ move_download(struct download *old, struct download *new,
|
||||
new->state = conn->state;
|
||||
new->pri = newpri;
|
||||
|
||||
if (is_in_result_state(old->state)) {
|
||||
if (new->callback)
|
||||
new->callback(new, new->data);
|
||||
return;
|
||||
}
|
||||
|
||||
change_connection(old, new, newpri, 0);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user