return EXIT_FAILURE;
}
+ /* don't bind the port if we're just running the CLI
+ * to get metainfo or to create a torrent */
+ if( showInfo || ( sourceFile != NULL ) )
+ bindPort = -1;
+
/* Initialize libtransmission */
h = tr_initFull( tr_getDefaultConfigDir(),
"cli", /* tag */
s->bindSocket = -1;
}
- if( s->bindPort != s->publicPort )
+ if( ( s->publicPort > 0 ) && ( s->bindPort != s->publicPort ) )
{
int socket;
errno = 0;
socket = tr_netBindTCP( s->publicPort );
+fprintf( stderr, "opening socket on %d to listen\n", s->publicPort );
if( socket >= 0 ) {
tr_ninf( getKey(), _( "Opened port %d to listen for incoming peer connections" ), s->publicPort );
s->bindPort = s->publicPort;