1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 17:17:31 +00:00

Show whether a tracker is http or udp. Without that context, it could be confusing to see the same tracker twice in a tier

This commit is contained in:
Jordan Lee 2011-03-15 17:03:09 +00:00
parent fee784f1d8
commit 591b95286f
2 changed files with 10 additions and 10 deletions

View file

@ -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 ? "<i>" : "<b>" );
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 ? "</i>" : "</b>" );

View file

@ -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;
}