diff -ur transmission-SVN.old/libtransmission/rpcimpl.c transmission-SVN/libtransmission/rpcimpl.c
old
|
new
|
|
124 | 124 | { |
125 | 125 | int torrentCount = 0; |
126 | 126 | int64_t id; |
| 127 | char * id_str; |
127 | 128 | tr_torrent ** torrents = NULL; |
128 | 129 | tr_benc * ids; |
129 | 130 | |
… |
… |
|
155 | 156 | if( ( tor = tr_torrentFindFromId( session, id ) ) ) |
156 | 157 | torrents[torrentCount++] = tor; |
157 | 158 | } |
| 159 | else if( tr_bencDictFindStr( args, "ids", &id_str ) |
| 160 | && (strncmp( id_str, "done", 4 ) == 0)) |
| 161 | { |
| 162 | tr_torrent * tor = NULL; |
| 163 | const int n = tr_sessionCountTorrents( session ); |
| 164 | const tr_stat * st; |
| 165 | |
| 166 | torrents = tr_new0( tr_torrent *, n ); |
| 167 | while( ( tor = tr_torrentNext( session, tor ) ) ) { |
| 168 | st = tr_torrentStat( (tr_torrent*)tor ); |
| 169 | if( st->eta == TR_ETA_UNKNOWN && st->leftUntilDone == 0 ) |
| 170 | torrents[torrentCount++] = tor; |
| 171 | } |
| 172 | } |
158 | 173 | else /* all of them */ |
159 | 174 | { |
160 | 175 | tr_torrent * tor = NULL; |