Changeset 7345
- Timestamp:
- Dec 10, 2008, 7:00:19 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/daemon.c
r7151 r7345 91 91 replaceInt( &d, KEY_PEER_LIMIT, tr_sessionGetPeerLimit( s ) ); 92 92 replaceInt( &d, KEY_PEER_PORT, tr_sessionGetPeerPort( s ) ); 93 replaceInt( &d, KEY_PORT_FORWARDING, 94 tr_sessionIsPortForwardingEnabled( s ) ); 93 replaceInt( &d, KEY_PORT_FORWARDING, tr_sessionIsPortForwardingEnabled( s ) ); 95 94 replaceInt( &d, KEY_PEX_ENABLED, tr_sessionIsPexEnabled( s ) ); 96 replaceStr( &d, KEY_USERNAME, strs[n++] = 97 tr_sessionGetRPCUsername( 98 s ) ); 99 replaceStr( &d, KEY_PASSWORD, strs[n++] = 100 tr_sessionGetRPCPassword( 101 s ) ); 95 replaceStr( &d, KEY_USERNAME, strs[n++] = tr_sessionGetRPCUsername( s ) ); 96 replaceStr( &d, KEY_PASSWORD, strs[n++] = tr_sessionGetRPCPassword( s ) ); 102 97 replaceStr( &d, KEY_WHITELIST, strs[n++] = tr_sessionGetRPCWhitelist( s ) ); 103 98 replaceInt( &d, KEY_RPC_PORT, tr_sessionGetRPCPort( s ) ); 104 99 replaceInt( &d, KEY_AUTH_REQUIRED, tr_sessionIsRPCPasswordEnabled( s ) ); 105 replaceInt( &d, KEY_DSPEED, 106 tr_sessionGetSpeedLimit( s, TR_DOWN ) ); 107 replaceInt( &d, KEY_DSPEED_ENABLED, 108 tr_sessionIsSpeedLimitEnabled( s, TR_DOWN ) ); 100 replaceInt( &d, KEY_DSPEED, tr_sessionGetSpeedLimit( s, TR_DOWN ) ); 101 replaceInt( &d, KEY_DSPEED_ENABLED, tr_sessionIsSpeedLimitEnabled( s, TR_DOWN ) ); 109 102 replaceInt( &d, KEY_USPEED, tr_sessionGetSpeedLimit( s, TR_UP ) ); 110 replaceInt( &d, KEY_USPEED_ENABLED, 111 tr_sessionIsSpeedLimitEnabled( s, TR_UP ) ); 103 replaceInt( &d, KEY_USPEED_ENABLED, tr_sessionIsSpeedLimitEnabled( s, TR_UP ) ); 112 104 replaceInt( &d, KEY_ENCRYPTION, tr_sessionGetEncryption( s ) ); 113 105 … … 181 173 if( !tr_bencLoadJSONFile( myConfigFilename, &state ) ) 182 174 dict = &state; 175 183 176 184 177 /*** … … 189 182 ***/ 190 183 191 getConfigStr( dict, KEY_DOWNLOAD_DIR, &downloadDir, 192 TR_DEFAULT_DOWNLOAD_DIR ); 193 getConfigInt( dict, KEY_PEX_ENABLED, &pexEnabled, 194 TR_DEFAULT_PEX_ENABLED ); 195 getConfigInt( dict, KEY_PORT_FORWARDING, &fwdEnabled, 196 TR_DEFAULT_PORT_FORWARDING_ENABLED ); 197 getConfigInt( dict, KEY_PEER_PORT, &peerPort, 198 TR_DEFAULT_PORT ); 199 getConfigInt( dict, KEY_DSPEED, &downLimit, 100 ); 200 getConfigInt( dict, KEY_DSPEED_ENABLED, &downLimited, FALSE ); 201 getConfigInt( dict, KEY_USPEED, &upLimit, 100 ); 202 getConfigInt( dict, KEY_USPEED_ENABLED, &upLimited, FALSE ); 203 getConfigInt( dict, KEY_LAZY_BITFIELD, &useLazyBitfield, 204 TR_DEFAULT_LAZY_BITFIELD_ENABLED ); 205 getConfigInt( dict, KEY_PEER_LIMIT, &peers, 206 TR_DEFAULT_GLOBAL_PEER_LIMIT ); 207 getConfigInt( dict, KEY_BLOCKLIST, &blocklistEnabled, 208 TR_DEFAULT_BLOCKLIST_ENABLED ); 209 getConfigInt( dict, KEY_RPC_PORT, &rpcPort, 210 TR_DEFAULT_RPC_PORT ); 211 getConfigInt( dict, KEY_WHITELIST_ENABLED, &whitelistEnabled, 212 TR_DEFAULT_RPC_WHITELIST_ENABLED ); 213 getConfigStr( dict, KEY_WHITELIST, &whitelist, 214 TR_DEFAULT_RPC_WHITELIST ); 215 getConfigInt( dict, KEY_AUTH_REQUIRED, &authRequired, FALSE ); 216 getConfigStr( dict, KEY_USERNAME, &username, NULL ); 217 getConfigStr( dict, KEY_PASSWORD, &password, NULL ); 218 getConfigInt( dict, KEY_ENCRYPTION, &encryption, 219 TR_DEFAULT_ENCRYPTION ); 184 getConfigStr( dict, KEY_DOWNLOAD_DIR, &downloadDir, TR_DEFAULT_DOWNLOAD_DIR ); 185 getConfigInt( dict, KEY_PEX_ENABLED, &pexEnabled, TR_DEFAULT_PEX_ENABLED ); 186 getConfigInt( dict, KEY_PORT_FORWARDING, &fwdEnabled, TR_DEFAULT_PORT_FORWARDING_ENABLED ); 187 getConfigInt( dict, KEY_PEER_PORT, &peerPort, TR_DEFAULT_PORT ); 188 getConfigInt( dict, KEY_DSPEED, &downLimit, 100 ); 189 getConfigInt( dict, KEY_DSPEED_ENABLED, &downLimited, FALSE ); 190 getConfigInt( dict, KEY_USPEED, &upLimit, 100 ); 191 getConfigInt( dict, KEY_USPEED_ENABLED, &upLimited, FALSE ); 192 getConfigInt( dict, KEY_LAZY_BITFIELD, &useLazyBitfield, TR_DEFAULT_LAZY_BITFIELD_ENABLED ); 193 getConfigInt( dict, KEY_PEER_LIMIT, &peers, TR_DEFAULT_GLOBAL_PEER_LIMIT ); 194 getConfigInt( dict, KEY_BLOCKLIST, &blocklistEnabled, TR_DEFAULT_BLOCKLIST_ENABLED ); 195 getConfigInt( dict, KEY_RPC_PORT, &rpcPort, TR_DEFAULT_RPC_PORT ); 196 getConfigStr( dict, KEY_WHITELIST, &whitelist, TR_DEFAULT_RPC_WHITELIST ); 197 getConfigInt( dict, KEY_AUTH_REQUIRED, &authRequired, FALSE ); 198 getConfigStr( dict, KEY_USERNAME, &username, NULL ); 199 getConfigStr( dict, KEY_PASSWORD, &password, NULL ); 200 getConfigInt( dict, KEY_ENCRYPTION, &encryption, TR_DEFAULT_ENCRYPTION ); 201 202 whitelistEnabled = whitelist && *whitelist; 220 203 221 204 /***
Note: See TracChangeset
for help on using the changeset viewer.