Ignore:
Timestamp:
Mar 29, 2009, 11:05:32 PM (13 years ago)
Author:
charles
Message:

(trunk) use tr_bencDict{Find,Add}Bool() where appropriate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpc-server.c

    r8081 r8108  
    173173                        b64 = tr_base64_encode( body, body_len, NULL );
    174174                        tr_bencDictAddStr( args, "metainfo", b64 );
    175                         tr_bencDictAddInt( args, "paused", paused );
     175                        tr_bencDictAddBool( args, "paused", paused );
    176176                        tr_bencSaveAsJSON( &top, json );
    177177                        tr_rpc_request_exec_json( server->session,
     
    737737    tr_rpc_server * s;
    738738    tr_bool found;
     739    tr_bool boolVal;
    739740    int64_t i;
    740741    const char *str;
     
    743744    s->session = session;
    744745
    745     found = tr_bencDictFindInt( settings, TR_PREFS_KEY_RPC_ENABLED, &i );
     746    found = tr_bencDictFindBool( settings, TR_PREFS_KEY_RPC_ENABLED, &boolVal );
    746747    assert( found );
    747     s->isEnabled = i != 0;
     748    s->isEnabled = boolVal;
    748749
    749750    found = tr_bencDictFindInt( settings, TR_PREFS_KEY_RPC_PORT, &i );
     
    751752    s->port = i;
    752753
    753     found = tr_bencDictFindInt( settings, TR_PREFS_KEY_RPC_WHITELIST_ENABLED, &i );
     754    found = tr_bencDictFindBool( settings, TR_PREFS_KEY_RPC_WHITELIST_ENABLED, &boolVal );
    754755    assert( found );
    755     s->isWhitelistEnabled = i != 0;
    756 
    757     found = tr_bencDictFindInt( settings, TR_PREFS_KEY_RPC_AUTH_REQUIRED, &i );
     756    s->isWhitelistEnabled = boolVal;
     757
     758    found = tr_bencDictFindBool( settings, TR_PREFS_KEY_RPC_AUTH_REQUIRED, &boolVal );
    758759    assert( found );
    759     s->isPasswordEnabled = i != 0;
     760    s->isPasswordEnabled = boolVal;
    760761
    761762    found = tr_bencDictFindStr( settings, TR_PREFS_KEY_RPC_WHITELIST, &str );
Note: See TracChangeset for help on using the changeset viewer.