diff --git a/libtransmission/webseed.cc b/libtransmission/webseed.cc index 60b7a3167..17d78417a 100644 --- a/libtransmission/webseed.cc +++ b/libtransmission/webseed.cc @@ -373,13 +373,8 @@ void onBufferGotData(evbuffer* /*buf*/, evbuffer_cb_info const* info, void* vtas return; } - auto const* const session = task->session; - auto const lock = session->unique_lock(); - - auto* const webseed = task->webseed; - webseed->gotPieceData(n_added); - - useFetchedBlocks(task); + auto const lock = task->session->unique_lock(); + task->webseed->gotPieceData(n_added); } void task_request_next_chunk(tr_webseed_task* task); @@ -444,6 +439,8 @@ void onPartialDataFetched(tr_web::FetchResponse const& web_response) return; } + useFetchedBlocks(task); + if (task->loc.byte < task->end_byte) { // Request finished successfully but there's still data missing.