From db65eaaa00c2e0582f75a6946caa5d9173bcc198 Mon Sep 17 00:00:00 2001 From: Steven Siloti Date: Thu, 15 Dec 2016 14:11:31 -0800 Subject: [PATCH] submit disk jobs from read_piece right away Without this the jobs get submitted on the next tick which may take a while. --- src/torrent.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/torrent.cpp b/src/torrent.cpp index d547fa240..e91afbc01 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -1028,6 +1028,8 @@ namespace libtorrent get_handle(), r.piece, rp->piece_data, 0); return; } + + m_ses.deferred_submit_jobs(); for (int i = 0; i < blocks_in_piece; ++i, r.start += block_size()) { r.length = (std::min)(piece_size - r.start, block_size());