Changeset 346 for trunk/libtransmission


Ignore:
Timestamp:
Jun 13, 2006, 12:28:03 AM (15 years ago)
Author:
titer
Message:

Fixes #22 (all torrents apparently at 0 % when T restarts)

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/inout.c

    r310 r346  
    6262
    6363/***********************************************************************
     64 * tr_ioLoadResume
     65 ***********************************************************************
     66 * Try to load the fast resume file
     67 **********************************************************************/
     68void tr_ioLoadResume( tr_torrent_t * tor )
     69{
     70    tr_io_t * io;
     71    tr_info_t * inf = &tor->info;
     72
     73    io      = malloc( sizeof( tr_io_t ) );
     74    io->tor = tor;
     75
     76    io->pieceSlot = malloc( inf->pieceCount * sizeof( int ) );
     77    io->slotPiece = malloc( inf->pieceCount * sizeof( int ) );
     78
     79    fastResumeLoad( io );
     80
     81    free( io->pieceSlot );
     82    free( io->slotPiece );
     83    free( io );
     84}
     85
     86/***********************************************************************
    6487 * tr_ioInit
    6588 ***********************************************************************
  • trunk/libtransmission/inout.h

    r261 r346  
    2828typedef struct tr_io_s tr_io_t;
    2929
     30void      tr_ioLoadResume  ( tr_torrent_t * );
     31
    3032tr_io_t * tr_ioInit        ( tr_torrent_t * );
    3133int       tr_ioRead        ( tr_io_t *, int, int, int, uint8_t * );
  • trunk/libtransmission/transmission.c

    r310 r346  
    318318{
    319319    tor->destination = strdup( path );
     320    tr_ioLoadResume( tor );
    320321}
    321322
Note: See TracChangeset for help on using the changeset viewer.