Ticket #1590: daemon_random_port_support.diff
File daemon_random_port_support.diff, 2.1 KB (added by Waldorf, 12 years ago) |
---|
-
libtransmission/session.h
69 69 70 70 struct tr_event_handle * events; 71 71 72 intproxyPort;72 tr_port proxyPort; 73 73 int peerSocketTOS; 74 74 75 75 int torrentCount; -
daemon/daemon.c
38 38 #define KEY_LAZY_BITFIELD "lazy-bitfield-enabled" 39 39 #define KEY_PEER_LIMIT "max-peers-global" 40 40 #define KEY_PEER_PORT "peer-port" 41 #define KEY_PEER_PORT_RANDOM "peer-port-random" 41 42 #define KEY_PORT_FORWARDING "port-forwarding-enabled" 42 43 #define KEY_PEX_ENABLED "pex-enabled" 43 44 #define KEY_AUTH_REQUIRED "rpc-authentication-required" … … 160 161 { 161 162 tr_benc state, *dict = NULL; 162 163 int peerPort = -1, peers = -1; 164 int peerPortIsRandom = -1; 163 165 int whitelistEnabled = -1; 164 166 int pexEnabled = -1; 165 167 int fwdEnabled = -1; … … 185 187 getConfigInt( dict, KEY_PEX_ENABLED, &pexEnabled, TR_DEFAULT_PEX_ENABLED ); 186 188 getConfigInt( dict, KEY_PORT_FORWARDING, &fwdEnabled, TR_DEFAULT_PORT_FORWARDING_ENABLED ); 187 189 getConfigInt( dict, KEY_PEER_PORT, &peerPort, TR_DEFAULT_PORT ); 190 getConfigInt( dict, KEY_PEER_PORT_RANDOM, &peerPortIsRandom, FALSE ); 188 191 getConfigInt( dict, KEY_DSPEED, &downLimit, 100 ); 189 192 getConfigInt( dict, KEY_DSPEED_ENABLED, &downLimited, FALSE ); 190 193 getConfigInt( dict, KEY_USPEED, &upLimit, 100 ); … … 200 203 getConfigInt( dict, KEY_ENCRYPTION, &encryption, TR_DEFAULT_ENCRYPTION ); 201 204 202 205 whitelistEnabled = whitelist && *whitelist; 203 206 if ( peerPortIsRandom ) 207 peerPort = -1; 208 204 209 /*** 205 210 **** 206 211 ***/