diff --git a/gtk/details.c b/gtk/details.c index 3d4bbb728..c296de02a 100644 --- a/gtk/details.c +++ b/gtk/details.c @@ -1794,15 +1794,11 @@ buildTrackerSummary( const char * key, const tr_tracker_stat * st, gboolean show /* hostname */ { - const char * host = st->host; - const char * pch = strstr( host, "://" ); - if( pch ) - host = pch + 3; g_string_append( gstr, st->isBackup ? "" : "" ); if( key ) - str = g_markup_printf_escaped( "%s - %s", host, key ); + str = g_markup_printf_escaped( "%s - %s", st->host, key ); else - str = g_markup_printf_escaped( "%s", host ); + str = g_markup_printf_escaped( "%s", st->host ); g_string_append( gstr, str ); g_free( str ); g_string_append( gstr, st->isBackup ? "" : "" ); diff --git a/libtransmission/announcer.c b/libtransmission/announcer.c index c1be5fd59..d4bff777d 100644 --- a/libtransmission/announcer.c +++ b/libtransmission/announcer.c @@ -213,12 +213,16 @@ tr_tracker; static char * getKey( const char * url ) { - int port = 0; - char * host = NULL; char * ret; - tr_urlParse( url, -1, NULL, &host, &port, NULL ); - ret = tr_strdup_printf( "%s:%d", ( host ? host : "invalid" ), port ); + char * scheme = NULL; + char * host = NULL; + int port = 0; + + tr_urlParse( url, -1, &scheme, &host, &port, NULL ); + ret = tr_strdup_printf( "%s://%s:%d", (scheme?scheme:"invalid"), (host?host:"invalid"), port ); + tr_free( host ); + tr_free( scheme ); return ret; }