mirror of
https://github.com/transmission/transmission
synced 2025-02-13 01:44:40 +00:00
(cli) #462: The -p --port command line param doesn't work
This commit is contained in:
parent
a867f050f4
commit
9661762908
1 changed files with 12 additions and 13 deletions
|
@ -131,9 +131,6 @@ int main( int argc, char ** argv )
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* +1 to convert from cli's verbosity (0-2) to messageLevel (1-3) */
|
|
||||||
tr_setMessageLevel( verboseLevel + 1 );
|
|
||||||
|
|
||||||
if( bindPort < 1 || bindPort > 65535 )
|
if( bindPort < 1 || bindPort > 65535 )
|
||||||
{
|
{
|
||||||
printf( "Invalid port '%d'\n", bindPort );
|
printf( "Invalid port '%d'\n", bindPort );
|
||||||
|
@ -141,7 +138,18 @@ int main( int argc, char ** argv )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize libtransmission */
|
/* Initialize libtransmission */
|
||||||
h = tr_init( "cli" );
|
h = tr_initFull( "cli",
|
||||||
|
1, /* pex enabled */
|
||||||
|
natTraversal, /* nat enabled */
|
||||||
|
bindPort, /* public port */
|
||||||
|
TR_ENCRYPTION_PREFERRED, /* encryption mode */
|
||||||
|
uploadLimit > 0, /* use upload speed limit? */
|
||||||
|
uploadLimit, /* upload speed limit */
|
||||||
|
downloadLimit > 0, /* use download speed limit? */
|
||||||
|
downloadLimit, /* download speed limit */
|
||||||
|
512, /* globalPeerLimit */
|
||||||
|
verboseLevel + 1, /* messageLevel */
|
||||||
|
0 ); /* is message queueing enabled? */
|
||||||
|
|
||||||
if( sourceFile && *sourceFile ) /* creating a torrent */
|
if( sourceFile && *sourceFile ) /* creating a torrent */
|
||||||
{
|
{
|
||||||
|
@ -239,15 +247,6 @@ int main( int argc, char ** argv )
|
||||||
signal( SIGINT, sigHandler );
|
signal( SIGINT, sigHandler );
|
||||||
signal( SIGHUP, sigHandler );
|
signal( SIGHUP, sigHandler );
|
||||||
|
|
||||||
tr_setBindPort( h, bindPort );
|
|
||||||
|
|
||||||
tr_setGlobalSpeedLimit ( h, TR_UP, uploadLimit );
|
|
||||||
tr_setUseGlobalSpeedLimit( h, TR_UP, uploadLimit > 0 );
|
|
||||||
tr_setGlobalSpeedLimit ( h, TR_DOWN, downloadLimit );
|
|
||||||
tr_setUseGlobalSpeedLimit( h, TR_DOWN, downloadLimit > 0 );
|
|
||||||
|
|
||||||
tr_natTraversalEnable( h, natTraversal );
|
|
||||||
|
|
||||||
tr_torrentSetStatusCallback( tor, torrentStateChanged, NULL );
|
tr_torrentSetStatusCallback( tor, torrentStateChanged, NULL );
|
||||||
tr_torrentStart( tor );
|
tr_torrentStart( tor );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue