1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-07 06:54:40 +00:00

(trunk daemon) #4648 "Transmission-Remote With Full URL Specified Broken" -- fixed with patch from niol

This commit is contained in:
Jordan Lee 2011-12-10 18:34:36 +00:00
parent 7d14f9617b
commit 74b8552521

View file

@ -211,7 +211,7 @@ getUsage( void )
" "
MY_NAME " [host:port] [options]\n"
" "
MY_NAME " [http://host:port/transmission/] [options]\n"
MY_NAME " [http(s?)://host:port/transmission/] [options]\n"
"\n"
"See the man page for detailed explanations and many examples.";
}
@ -2334,7 +2334,7 @@ processArgs( const char * rpcurl, int argc, const char ** argv )
return status;
}
/* [host:port] or [host] or [port] or [http://host:port/transmission/] */
/* [host:port] or [host] or [port] or [http(s?)://host:port/transmission/] */
static void
getHostAndPortAndRpcUrl( int * argc, char ** argv,
char ** host, int * port, char ** rpcurl )
@ -2344,9 +2344,14 @@ getHostAndPortAndRpcUrl( int * argc, char ** argv,
int i;
const char * s = argv[1];
const char * delim = strchr( s, ':' );
if( !strncmp(s, "http://", 7 ) ) /* user passed in full rpc url */
if( !strncmp(s, "http://", 7 ) ) /* user passed in http rpc url */
{
*rpcurl = tr_strdup_printf( "%s/rpc/", s );
*rpcurl = tr_strdup_printf( "%s/rpc/", s + 7 );
}
else if( !strncmp(s, "https://", 8) ) /* user passed in https rpc url */
{
UseSSL = true;
*rpcurl = tr_strdup_printf( "%s/rpc/", s + 8 );
}
else if( delim ) /* user passed in both host and port */
{