Changeset 10043


Ignore:
Timestamp:
Jan 29, 2010, 4:43:39 PM (12 years ago)
Author:
charles
Message:

(trunk daemon) #2786 "Trigger blocklist update using transmission-remote" -- patch applied for 1.90

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/remote.c

    r9890 r10043  
    4141#define DEFAULT_PORT atoi(TR_DEFAULT_RPC_PORT_STR)
    4242
    43 enum { TAG_SESSION, TAG_STATS, TAG_LIST, TAG_DETAILS, TAG_FILES, TAG_PEERS };
     43enum { TAG_SESSION, TAG_STATS, TAG_LIST, TAG_DETAILS, TAG_FILES, TAG_PEERS, TAG_PORTTEST };
    4444
    4545static const char*
     
    7373    { 977, "alt-speed-time-end",    "Time to stop using the alt speed limits (in hhmm)", NULL,  1, "<time>" },
    7474    { 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 },
    7576    { 'c', "incomplete-dir",        "Where to store new torrents until they're complete", "c", 1, "<dir>" },
    7677    { 'C', "no-incomplete-dir",     "Don't store incomplete torrents in a different location", "C", 0, NULL },
     
    9798    { 'O', "no-dht",                "Disable distributed hash tables (DHT)", "O", 0, NULL },
    9899    { 'p', "port",                  "Port for incoming peers (Default: " TR_DEFAULT_PEER_PORT_STR ")", "p", 1, "<port>" },
     100    { 962, "port-test",             "Port testing", "pt", 0, NULL },
    99101    { 'P', "random-port",           "Random port for incomping peers", "P", 0, NULL },
    100102    { 900, "priority-high",         "Set the files' priorities as high", "ph", 1, "<files>" },
     
    702704                break;
    703705
     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
    704715            case 970:
    705716                tr_bencDictAddStr( &top, "method", "session-set" );
     
    16031614
    16041615static void
     1616printPortTest( 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
     1628static void
    16051629printTorrentList( tr_benc * top )
    16061630{
     
    17271751                printPeers( &top ); break;
    17281752
     1753            case TAG_PORTTEST:
     1754                printPortTest( &top ); break;
     1755
    17291756            default:
    17301757                if( !tr_bencDictFindStr( &top, "result", &str ) )
Note: See TracChangeset for help on using the changeset viewer.