Changeset 7547


Ignore:
Timestamp:
Dec 30, 2008, 6:18:34 PM (12 years ago)
Author:
charles
Message:

(trunk daemon) #1618: patch from er13 to make transmission-daemon's encryption, port, and peer limit command-line arguments similar to transmission-remote's

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/daemon.c

    r7537 r7547  
    6666    { 'v', "password", "Set password for authentication", "v", 1, "<password>" },
    6767    { 'w', "download-dir", "Where to save downloaded data", "w", 1, "<path>" },
     68    { 'P', "peerport", "Port for incoming peers (Default: " TR_DEFAULT_PEER_PORT_STR ")", "P", 1, "<port>" },
     69    { 'm', "portmap", "Enable portmapping via NAT-PMP or UPnP", "m", 0, NULL },
     70    { 'M', "no-portmap", "Disable portmapping", "M", 0, NULL },
     71    { 'L', "peerlimit-global", "Maximum overall number of peers (Default: " TR_DEFAULT_PEER_LIMIT_GLOBAL_STR ")", "L", 1, "<limit>" },
     72    { 'l', "peerlimit-torrent", "Maximum number of peers per torrent (Default: " TR_DEFAULT_PEER_LIMIT_TORRENT_STR ")", "l", 1, "<limit>" },
     73    { 910, "encryption-required",  "Encrypt all peer connections", "er", 0, NULL },
     74    { 911, "encryption-preferred", "Prefer encrypted peer connections", "ep", 0, NULL },
     75    { 912, "encryption-tolerated", "Prefer unencrypted peer connections", "et", 0, NULL },
    6876    { 0, NULL, NULL, NULL, 0, NULL }
    6977};
     
    215223            case 'w': tr_bencDictAddStr( &settings, TR_PREFS_KEY_DOWNLOAD_DIR, optarg );
    216224                      break;
     225            case 'P': tr_bencDictAddInt( &settings, TR_PREFS_KEY_PEER_PORT, atoi( optarg ) );
     226                      break;
     227            case 'm': tr_bencDictAddInt( &settings, TR_PREFS_KEY_PORT_FORWARDING, 1 );
     228                      break;
     229            case 'M': tr_bencDictAddInt( &settings, TR_PREFS_KEY_PORT_FORWARDING, 0 );
     230                      break;
     231            case 'L': tr_bencDictAddInt( &settings, TR_PREFS_KEY_PEER_LIMIT_GLOBAL, atoi( optarg ) );
     232                      break;
     233            case 'l': tr_bencDictAddInt( &settings, TR_PREFS_KEY_PEER_LIMIT_TORRENT, atoi( optarg ) );
     234                      break;
     235            case 910: tr_bencDictAddInt( &settings, TR_PREFS_KEY_ENCRYPTION, TR_ENCRYPTION_REQUIRED );
     236                      break;
     237            case 911: tr_bencDictAddInt( &settings, TR_PREFS_KEY_ENCRYPTION, TR_CLEAR_PREFERRED );
     238                      break;
     239            case 912: tr_bencDictAddInt( &settings, TR_PREFS_KEY_ENCRYPTION, TR_ENCRYPTION_PREFERRED );
     240                      break;
    217241            default:  showUsage( );
    218242                      break;
  • trunk/daemon/transmission-daemon.1

    r7482 r7547  
    1919.Op Fl u Ar username
    2020.Op Fl v Ar password
     21.Op Fl P Ar port
     22.Op Fl m | M
     23.Op Fl l Ar limit
     24.Op Fl L Ar limit
     25.Op Fl er | ep | et
    2126.Op Fl w Ar download-dir
    2227.Ek
     
    5055Where to look for .torrent and config files on startup.
    5156
     57.It Fl er Fl -encryption-required
     58Encrypt all peer connections.
     59.It Fl ep Fl -encryption-preferred
     60Prefer encrypted peer connections.
     61.It Fl et Fl -encryption-tolerated
     62Prefer unencrypted peer connections.
     63
    5264.It Fl h Fl -help
    5365Print command-line option descriptions.
    5466
     67.It Fl L Fl -peerlimit-global Ar limit
     68Overall peer limit. Useful on embedded systems where the default might be unsuitable. Default: 240
     69.It Fl l Fl -peerlimit-torrent Ar limit
     70Peer limit per torrent. Useful on embedded systems where the default might be unsuitable. Default: 60
     71
     72.It Fl m Fl -portmap
     73Enable portmapping via NAT-PMP or UPnP
     74.It Fl M Fl -no-portmap
     75Disable portmapping
     76
    5577.It Fl p Fl -port Ar port
    5678Port to open and listen for RPC requests on.  Default: 9091
     79
     80.It Fl P, -peerport Ar port
     81Port to listen for incoming peers on. Default: 51413
    5782
    5883.It Fl t Fl -auth
  • trunk/libtransmission/session.c

    r7530 r7547  
    222222    tr_bencDictAddInt( d, TR_PREFS_KEY_LAZY_BITFIELD,            TRUE );
    223223    tr_bencDictAddInt( d, TR_PREFS_KEY_MSGLEVEL,                 TR_MSG_INF );
    224     tr_bencDictAddInt( d, TR_PREFS_KEY_PEER_LIMIT_GLOBAL,        240 );
    225     tr_bencDictAddInt( d, TR_PREFS_KEY_PEER_LIMIT_TORRENT,       60 );
     224    tr_bencDictAddInt( d, TR_PREFS_KEY_PEER_LIMIT_GLOBAL,        atoi( TR_DEFAULT_PEER_LIMIT_GLOBAL_STR ) );
     225    tr_bencDictAddInt( d, TR_PREFS_KEY_PEER_LIMIT_TORRENT,       atoi( TR_DEFAULT_PEER_LIMIT_TORRENT_STR ) );
    226226    tr_bencDictAddInt( d, TR_PREFS_KEY_PEER_PORT,                atoi( TR_DEFAULT_PEER_PORT_STR ) );
    227227    tr_bencDictAddInt( d, TR_PREFS_KEY_PEER_PORT_RANDOM_ENABLED, FALSE );
  • trunk/libtransmission/transmission.h

    r7476 r7547  
    119119#define TR_DEFAULT_PEER_PORT_STR "51413"
    120120#define TR_DEFAULT_PEER_SOCKET_TOS_STR "8"
     121#define TR_DEFAULT_PEER_LIMIT_GLOBAL_STR "240"
     122#define TR_DEFAULT_PEER_LIMIT_TORRENT_STR "60"
    121123
    122124#define TR_PREFS_KEY_BLOCKLIST_ENABLED          "blocklist-enabled"
Note: See TracChangeset for help on using the changeset viewer.