- Timestamp:
- May 1, 2010, 4:12:15 AM (12 years ago)
- Location:
- branches/1.9x/libtransmission
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.9x/libtransmission/metainfo.c
r10239 r10575 35 35 ***/ 36 36 37 char* 38 tr_metainfoGetBasename( const tr_info * inf ) 39 { 40 char *ret, *pch, *name; 41 42 name = tr_strdup( inf->name ); 43 for( pch=name; pch && *pch; ++pch ) 44 if( *pch == '/' ) 45 *pch = '_'; 46 47 ret = tr_strdup_printf( "%s.%16.16s", name, inf->hashString ); 48 49 tr_free( name ); 50 return ret; 51 } 52 37 53 static char* 38 54 getTorrentFilename( const tr_session * session, 39 55 const tr_info * inf ) 40 56 { 41 return tr_strdup_printf( "%s%c%s.%16.16s.torrent",42 tr_getTorrentDir( session ),43 TR_PATH_DELIMITER,44 inf->name,45 inf->hashString );57 char * base = tr_metainfoGetBasename( inf ); 58 char * filename = tr_strdup_printf( "%s" TR_PATH_DELIMITER_STR "%s.torrent", 59 tr_getTorrentDir( session ), base ); 60 tr_free( base ); 61 return filename; 46 62 } 47 63 -
branches/1.9x/libtransmission/metainfo.h
r10084 r10575 35 35 tr_info * inf ); 36 36 37 char* tr_metainfoGetBasename( const tr_info * ); 38 37 39 38 40 #endif -
branches/1.9x/libtransmission/resume.c
r10084 r10575 18 18 #include "bencode.h" 19 19 #include "completion.h" 20 #include "metainfo.h" /* tr_metainfoGetBasename() */ 20 21 #include "peer-mgr.h" /* pex */ 21 #include "platform.h" /* tr_getResumeDir */22 #include "platform.h" /* tr_getResumeDir() */ 22 23 #include "resume.h" 23 24 #include "session.h" … … 67 68 getResumeFilename( const tr_torrent * tor ) 68 69 { 69 return tr_strdup_printf( "%s%c%s.%16.16s.resume",70 tr_getResumeDir( tor->session ),71 TR_PATH_DELIMITER,72 tr_torrentName( tor ),73 tor->info.hashString );70 char * base = tr_metainfoGetBasename( tr_torrentInfo( tor ) ); 71 char * filename = tr_strdup_printf( "%s" TR_PATH_DELIMITER_STR "%s.resume", 72 tr_getResumeDir( tor->session ), base ); 73 tr_free( base ); 74 return filename; 74 75 } 75 76 -
branches/1.9x/libtransmission/torrent-magnet.c
r10157 r10575 76 76 int i; 77 77 struct tr_incomplete_metadata * m; 78 int n = ( size + ( METADATA_PIECE_SIZE - 1 ) ) / METADATA_PIECE_SIZE;79 dbgmsg( tor, " there are %d pieces", n );78 const int n = ( size + ( METADATA_PIECE_SIZE - 1 ) ) / METADATA_PIECE_SIZE; 79 dbgmsg( tor, "metadata is %d bytes in %d pieces", size, n ); 80 80 81 81 m = tr_new( struct tr_incomplete_metadata, 1 );
Note: See TracChangeset
for help on using the changeset viewer.