Changeset 5579
- Timestamp:
- Apr 10, 2008, 7:02:24 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/server.c
r5514 r5579 487 487 if( TORRENT_ID_VALID( tor ) ) 488 488 { 489 const tr_info * inf = torrent_info( tor ); 490 if( 0 > ipc_addinfo( added, tor, inf, 0 ) ) 489 if( 0 > ipc_addinfo( added, tor, torrent_handle( tor ), 0 ) ) 491 490 { 492 491 errnomsg( "failed to build message" ); … … 545 544 if( TORRENT_ID_VALID( tor ) ) 546 545 { 547 const tr_info * inf;548 546 val = ipc_initval( client->ipc, IPC_MSG_INFO, tag, &pk, TYPE_LIST ); 549 547 if( NULL == val ) … … 553 551 return; 554 552 } 555 inf = torrent_info( tor ); 556 if( 0 > ipc_addinfo( val, tor, inf, 0 ) ) 553 if( 0 > ipc_addinfo( val, tor, torrent_handle( tor ), 0 ) ) 557 554 { 558 555 errnomsg( "failed to build message" ); … … 768 765 addinfo( benc_val_t * list, int id, int types ) 769 766 { 770 const tr_info * inf = torrent_info( id );771 return inf ? ipc_addinfo( list, id, inf, types ) : 0;767 tr_torrent * tor = torrent_handle( id ); 768 return tor ? ipc_addinfo( list, id, tor, types ) : 0; 772 769 } 773 770 … … 775 772 addstat( benc_val_t * list, int id, int types ) 776 773 { 777 const tr_stat * st = torrent_stat( id );778 return st ? ipc_addstat( list, id, st, types ) : 0;774 tr_torrent * tor = torrent_handle( id ); 775 return tor ? ipc_addstat( list, id, tor, types ) : 0; 779 776 } 780 777 … … 879 876 for( ii = 0; val->val.l.count > ii; ii++ ) 880 877 { 881 const tr_info * inf;882 878 hash = &val->val.l.vals[ii]; 883 879 if( !tr_bencIsString(hash) || SHA_DIGEST_LENGTH * 2 != hash->val.s.i ) … … 892 888 continue; 893 889 } 894 inf = torrent_info( found ); 895 assert( NULL != inf ); 896 if( 0 > ipc_addinfo( pkinf, found, inf, IPC_INF_HASH ) ) 890 if( 0 > ipc_addinfo( pkinf, found, torrent_handle( found ), IPC_INF_HASH ) ) 897 891 { 898 892 errnomsg( "failed to build message" ); -
trunk/daemon/torrents.c
r5517 r5579 231 231 } 232 232 233 tr_torrent * 234 torrent_handle( int id ) 235 { 236 const struct tor * tor = idlookup( id ); 237 return tor ? tor->tor : NULL; 238 } 239 233 240 const tr_info * 234 241 torrent_info( int id ) 235 242 { 236 const struct tor * tor = idlookup( id ); 237 return tor ? tr_torrentInfo( tor->tor ) : NULL; 243 return tr_torrentInfo( torrent_handle( id ) ); 238 244 } 239 245 … … 241 247 torrent_stat( int id ) 242 248 { 243 struct tor * tor = idlookup( id ); 244 return tor ? tr_torrentStat( tor->tor ) : NULL; 249 return tr_torrentStat( torrent_handle( id ) ); 245 250 } 246 251 -
trunk/daemon/torrents.h
r5143 r5579 39 39 void torrent_verify ( int ); 40 40 void torrent_remove ( int ); 41 const tr_info * torrent_info ( int ); 42 const tr_stat * torrent_stat ( int ); 41 tr_torrent * torrent_handle ( int ); 42 const tr_info * torrent_info ( int ); 43 const tr_stat * torrent_stat ( int ); 43 44 int torrent_lookup ( const uint8_t * ); 44 45 void * torrent_iter ( void *, int * ); -
trunk/gtk/ipc.c
r5506 r5579 619 619 620 620 static int 621 addinfo( TrTorrent * tor, enum ipc_msg msgid, int torid, int types,621 addinfo( TrTorrent * gtor, enum ipc_msg msgid, int torid, int types, 622 622 tr_benc * val ) 623 623 { 624 tr_torrent * tor = tr_torrent_handle( gtor ); 625 624 626 if( IPC_MSG_INFO == msgid ) 625 { 626 const tr_info * inf = tr_torrent_info( tor ); 627 return ipc_addinfo( val, torid, inf, types ); 628 } 627 return ipc_addinfo( val, torid, tor, types ); 629 628 else 630 { 631 const tr_stat * st = tr_torrent_stat( tor ); 632 return ipc_addstat( val, torid, st, types ); 633 } 629 return ipc_addstat( val, torid, tor, types ); 634 630 } 635 631 … … 794 790 int ii, torid; 795 791 TrTorrent * tor; 796 const tr_info * inf;797 792 uint8_t * buf; 798 793 size_t size; … … 820 815 continue; 821 816 } 822 inf = tr_torrent_info( tor ); 823 if( 0 > ipc_addinfo( pkval, torid, inf, IPC_INF_HASH ) ) 817 if( 0 > ipc_addinfo( pkval, torid, tr_torrent_handle( tor ), IPC_INF_HASH ) ) 824 818 { 825 819 tr_bencFree( &packet ); -
trunk/libtransmission/ipcparse.c
r5547 r5579 553 553 ipc_addinfo( tr_benc * list, 554 554 int torrent_id, 555 const tr_info * inf,555 tr_torrent * tor, 556 556 int types ) 557 557 { … … 559 559 int ii, jj, kk; 560 560 tr_file_index_t ff; 561 const tr_info * inf = tr_torrentInfo( tor ); 561 562 562 563 /* always send torrent id */ -
trunk/libtransmission/ipcparse.h
r5547 r5579 171 171 const int * ids ); 172 172 173 int ipc_addinfo ( struct tr_benc *, int, 174 const struct tr_info *, int ); 173 struct tr_torrent; 175 174 176 struct tr_torrent; 175 int ipc_addinfo ( struct tr_benc * appendme_list, 176 int torrent_id, 177 struct tr_torrent * tor, 178 int info_types ); 177 179 178 180 int ipc_addstat ( struct tr_benc * appendme_list,
Note: See TracChangeset
for help on using the changeset viewer.