void request_tigertree(shared_file_t *sf, bool high_priority) { int inserted; verify_tth_init(); shared_file_check(sf); g_return_if_fail(shared_file_is_finished(sf)); if (!shared_file_is_servable(sf)) return; /* "stale" shared file, has been superseded or removed */ /* * This routine can be called when the VERIFY_DONE event is received by * huge_verify_callback(). We may have already shutdown the TTH * verification thread. */ if G_UNLIKELY(NULL == verify_tth.verify) return; sf = shared_file_ref(sf); inserted = verify_enqueue(verify_tth.verify, high_priority, shared_file_path(sf), 0, shared_file_size(sf), request_tigertree_callback, sf); if (!inserted) shared_file_unref(&sf); }
int verify_sha1_enqueue(int high_priority, const char *pathname, filesize_t filesize, verify_callback callback, void *user_data) { return verify_enqueue(verify_sha1.verify, high_priority, pathname, 0, filesize, callback, user_data); }
bool verify_tth_prepend(const char *pathname, filesize_t offset, filesize_t amount, verify_callback callback, void *user_data) { return verify_enqueue(verify_tth.verify, TRUE, pathname, offset, amount, callback, user_data); }
void request_tigertree(shared_file_t *sf, bool high_priority) { int inserted; verify_tth_init(); g_return_if_fail(sf); shared_file_check(sf); g_return_if_fail(!shared_file_is_partial(sf)); sf = shared_file_ref(sf); inserted = verify_enqueue(verify_tth.verify, high_priority, shared_file_path(sf), 0, shared_file_size(sf), request_tigertree_callback, sf); if (!inserted) shared_file_unref(&sf); }