Changeset 10043
- Timestamp:
- Jan 29, 2010, 4:43:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/remote.c
r9890 r10043 41 41 #define DEFAULT_PORT atoi(TR_DEFAULT_RPC_PORT_STR) 42 42 43 enum { TAG_SESSION, TAG_STATS, TAG_LIST, TAG_DETAILS, TAG_FILES, TAG_PEERS };43 enum { TAG_SESSION, TAG_STATS, TAG_LIST, TAG_DETAILS, TAG_FILES, TAG_PEERS, TAG_PORTTEST }; 44 44 45 45 static const char* … … 73 73 { 977, "alt-speed-time-end", "Time to stop using the alt speed limits (in hhmm)", NULL, 1, "<time>" }, 74 74 { 978, "alt-speed-days", "Numbers for any/all days of the week - eg. \"1-7\"", NULL, 1, "<days>" }, 75 { 963, "blocklist-update", "Blocklist update", NULL, 0, NULL }, 75 76 { 'c', "incomplete-dir", "Where to store new torrents until they're complete", "c", 1, "<dir>" }, 76 77 { 'C', "no-incomplete-dir", "Don't store incomplete torrents in a different location", "C", 0, NULL }, … … 97 98 { 'O', "no-dht", "Disable distributed hash tables (DHT)", "O", 0, NULL }, 98 99 { 'p', "port", "Port for incoming peers (Default: " TR_DEFAULT_PEER_PORT_STR ")", "p", 1, "<port>" }, 100 { 962, "port-test", "Port testing", "pt", 0, NULL }, 99 101 { 'P', "random-port", "Random port for incomping peers", "P", 0, NULL }, 100 102 { 900, "priority-high", "Set the files' priorities as high", "ph", 1, "<files>" }, … … 702 704 break; 703 705 706 case 962: 707 tr_bencDictAddStr( &top, "method", "port-test" ); 708 tr_bencDictAddInt( &top, "tag", TAG_PORTTEST ); 709 break; 710 711 case 963: 712 tr_bencDictAddStr( &top, "method", "blocklist-update" ); 713 break; 714 704 715 case 970: 705 716 tr_bencDictAddStr( &top, "method", "session-set" ); … … 1603 1614 1604 1615 static void 1616 printPortTest( tr_benc * top ) 1617 { 1618 tr_benc *args; 1619 if( ( tr_bencDictFindDict( top, "arguments", &args ) ) ) 1620 { 1621 tr_bool boolVal; 1622 1623 if( tr_bencDictFindBool( args, "port-is-open", &boolVal ) ) 1624 printf( "Port is open: %s\n", ( boolVal ? "Yes" : "No" ) ); 1625 } 1626 } 1627 1628 static void 1605 1629 printTorrentList( tr_benc * top ) 1606 1630 { … … 1727 1751 printPeers( &top ); break; 1728 1752 1753 case TAG_PORTTEST: 1754 printPortTest( &top ); break; 1755 1729 1756 default: 1730 1757 if( !tr_bencDictFindStr( &top, "result", &str ) )
Note: See TracChangeset
for help on using the changeset viewer.