Changeset 8
- Timestamp:
- Jan 12, 2006, 6:43:18 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/tracker.c
r6 r8 565 565 } 566 566 567 for( i = 0; i < ret- 8; i++ )567 for( i = 0; i < pos - 8; i++ ) 568 568 { 569 569 if( !memcmp( &buf[i], "d5:files", 8 ) ) … … 572 572 } 573 573 } 574 if( i >= ret- 8 )574 if( i >= pos - 8 ) 575 575 { 576 576 return 1; -
trunk/transmissioncli.c
r7 r8 41 41 " -v, --verbose <int> Verbose level (0 to 2, default = 0)\n" \ 42 42 " -p, --port <int> Port we should listen on (default = %d)\n" \ 43 " -u, --upload <int> Maximum upload rate (-1 = no limit, default = 20)\n" 43 " -u, --upload <int> Maximum upload rate (-1 = no limit, default = 20)\n" \ 44 " -f, --finish <shell script> Command you wish to run on completion\n" 44 45 45 46 static int showHelp = 0; … … 51 52 static char * torrentPath = NULL; 52 53 static volatile char mustDie = 0; 54 55 static char * finishCall = NULL; 53 56 54 57 static int parseCommandLine ( int argc, char ** argv ); … … 167 170 char string[80]; 168 171 int chars = 0; 172 int result; 169 173 170 174 sleep( 1 ); … … 204 208 { 205 209 fprintf( stderr, "\n" ); 210 } 211 212 if( tr_getFinished( h, 0 ) ) 213 { 214 tr_setFinished( h, 0, 0 ); 215 result = system(finishCall); 206 216 } 207 217 … … 245 255 { "port", required_argument, NULL, 'p' }, 246 256 { "upload", required_argument, NULL, 'u' }, 247 { 0, 0, 0, 0 } }; 257 { "finish", required_argument, NULL, 'f' }, 258 { 0, 0, 0, 0} }; 248 259 249 260 int c, optind = 0; 250 c = getopt_long( argc, argv, "hisv:p:u: ", long_options, &optind );261 c = getopt_long( argc, argv, "hisv:p:u:f:", long_options, &optind ); 251 262 if( c < 0 ) 252 263 { … … 272 283 case 'u': 273 284 uploadLimit = atoi( optarg ); 285 break; 286 case 'f': 287 finishCall = optarg; 274 288 break; 275 289 default:
Note: See TracChangeset
for help on using the changeset viewer.