Ignore:
Timestamp:
Jan 31, 2013, 9:58:25 PM (8 years ago)
Author:
jordan
Message:

(libT) change the API signature for tr_torrentVerify() s.t. client code can be notified when the verify is finished

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/libtransmission-test.c

    r13908 r13913  
    55#include "platform.h" /* TR_PATH_DELIMETER */
    66#include "torrent.h"
     7#include "trevent.h"
    78#include "libtransmission-test.h"
    89
     
    324325}
    325326
    326 #define verify_and_block_until_done(tor) \
    327   do { \
    328     do { tr_wait_msec (10); } while (tor->verifyState != TR_VERIFY_NONE); \
    329     tr_torrentVerify (tor); \
    330     do { tr_wait_msec (10); } while (tor->verifyState != TR_VERIFY_NONE); \
    331   } while (0)
    332 
    333 
    334327void
    335328libtransmission_test_zero_torrent_populate (tr_torrent * tor, bool complete)
     
    369362
    370363  sync ();
    371   verify_and_block_until_done (tor);
     364  libttest_blockingTorrentVerify (tor);
    372365
    373366  if (complete)
     
    376369    assert (tr_torrentStat(tor)->leftUntilDone == tor->info.pieceSize);
    377370}
     371
     372/***
     373****
     374***/
     375
     376static void
     377onVerifyDone (tr_torrent * tor UNUSED, bool aborted UNUSED, void * done)
     378{
     379  *(bool*)done = true;
     380}
     381
     382void
     383libttest_blockingTorrentVerify (tr_torrent * tor)
     384{
     385  bool done = false;
     386
     387  assert (session != NULL);
     388  assert (!tr_amInEventThread (session));
     389
     390  tr_torrentVerify (tor, onVerifyDone, &done);
     391  while (!done)
     392    tr_wait_msec (10);
     393}
Note: See TracChangeset for help on using the changeset viewer.