diff options
Diffstat (limited to 'src/RpcMethodImpl.cc')
| -rw-r--r-- | src/RpcMethodImpl.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/RpcMethodImpl.cc b/src/RpcMethodImpl.cc index 3b2c7d39..d808d83c 100644 --- a/src/RpcMethodImpl.cc +++ b/src/RpcMethodImpl.cc @@ -77,6 +77,7 @@ #include "BtRuntime.h" #include "BtAnnounce.h" #endif // ENABLE_BITTORRENT +#include "CheckIntegrityEntry.h" namespace aria2 { @@ -144,6 +145,8 @@ const char KEY_NUM_WAITING[] = "numWaiting"; const char KEY_NUM_STOPPED[] = "numStopped"; const char KEY_NUM_ACTIVE[] = "numActive"; const char KEY_NUM_STOPPED_TOTAL[] = "numStoppedTotal"; +const char KEY_VERIFIED_LENGTH[] = "verifiedLength"; +const char KEY_VERIFY_PENDING[] = "verifyIntegrityPending"; } // namespace namespace { @@ -793,6 +796,23 @@ void gatherProgress(Dict* entryDict, const std::shared_ptr<RequestGroup>& group, e->getBtRegistry()->get(group->getGID()), keys); } #endif // ENABLE_BITTORRENT + if (e->getCheckIntegrityMan()) { + if (e->getCheckIntegrityMan()->isPicked( + [&group](const CheckIntegrityEntry& ent) { + return ent.getRequestGroup() == group.get(); + })) { + entryDict->put( + KEY_VERIFIED_LENGTH, + util::itos( + e->getCheckIntegrityMan()->getPickedEntry()->getCurrentLength())); + } + if (e->getCheckIntegrityMan()->isQueued( + [&group](const CheckIntegrityEntry& ent) { + return ent.getRequestGroup() == group.get(); + })) { + entryDict->put(KEY_VERIFY_PENDING, VLB_TRUE); + } + } } } // namespace |
