From 48136473467df8139ffde94b444c4759870f6a26 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 14 Jul 2008 16:00:20 +0000 Subject: [PATCH] #1084: Make `web' and `clutch' synonymous in the backend --- libtransmission/platform.c | 8 ++++++-- libtransmission/rpc-server.c | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libtransmission/platform.c b/libtransmission/platform.c index 0282f39d8..62a4e372a 100644 --- a/libtransmission/platform.c +++ b/libtransmission/platform.c @@ -527,12 +527,16 @@ tr_getClutchDir( const tr_session * session UNUSED ) if( !s ) { - char path[MAX_PATH_LENGTH]; + char path[MAX_PATH_LENGTH] = { '\0' }; if(( s = getenv( "CLUTCH_HOME" ))) { snprintf( path, sizeof( path ), s ); } + else if(( s = getenv( "TRANSMISSION_WEB_HOME" ))) + { + snprintf( path, sizeof( path ), s ); + } else { #ifdef SYS_DARWIN @@ -575,7 +579,7 @@ tr_getClutchDir( const tr_session * session UNUSED ) } for( l=candidates; l; l=l->next ) { - tr_buildPath( path, sizeof( path ), l->data, "transmission", "clutch", NULL ); + tr_buildPath( path, sizeof( path ), l->data, "transmission", "web", NULL ); if( isClutchDir( path ) ) break; *path = '\0'; diff --git a/libtransmission/rpc-server.c b/libtransmission/rpc-server.c index f5cedc12b..6625f9296 100644 --- a/libtransmission/rpc-server.c +++ b/libtransmission/rpc-server.c @@ -267,7 +267,9 @@ startServer( tr_rpc_server * server ) shttpd_register_uri( server->ctx, "/transmission/upload", handle_upload, server ); if( clutchDir && *clutchDir ) { - char * clutchAlias = tr_strdup_printf( "%s=%s", "/transmission/clutch", clutchDir ); + char * clutchAlias = tr_strdup_printf( "%s=%s,%s=%s", + "/transmission/clutch", clutchDir, + "/transmission/web", clutchDir ); tr_inf( _( "Serving the web interface files from \"%s\"" ), clutchDir ); shttpd_set_option( server->ctx, "aliases", clutchAlias ); tr_free( clutchAlias );