diff --git a/src/network/connection.c b/src/network/connection.c index 1cfc7e95..f49cf01f 100644 --- a/src/network/connection.c +++ b/src/network/connection.c @@ -1078,6 +1078,10 @@ move_download(struct download *old, struct download *new, conn->pri[new->pri]++; add_to_list(conn->downloads, new); + /* In principle, we need to sort_queue() only if conn->pri[new->pri] + * just changed from 0 to 1. But the risk of bugs is smaller if we + * sort every time. */ + sort_queue(); cancel_download(old, 0); }