mirror of
https://github.com/transmission/transmission
synced 2024-12-26 17:47:37 +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:
parent
fee784f1d8
commit
591b95286f
2 changed files with 10 additions and 10 deletions
|
@ -1794,15 +1794,11 @@ buildTrackerSummary( const char * key, const tr_tracker_stat * st, gboolean show
|
||||||
|
|
||||||
/* hostname */
|
/* hostname */
|
||||||
{
|
{
|
||||||
const char * host = st->host;
|
|
||||||
const char * pch = strstr( host, "://" );
|
|
||||||
if( pch )
|
|
||||||
host = pch + 3;
|
|
||||||
g_string_append( gstr, st->isBackup ? "<i>" : "<b>" );
|
g_string_append( gstr, st->isBackup ? "<i>" : "<b>" );
|
||||||
if( key )
|
if( key )
|
||||||
str = g_markup_printf_escaped( "%s - %s", host, key );
|
str = g_markup_printf_escaped( "%s - %s", st->host, key );
|
||||||
else
|
else
|
||||||
str = g_markup_printf_escaped( "%s", host );
|
str = g_markup_printf_escaped( "%s", st->host );
|
||||||
g_string_append( gstr, str );
|
g_string_append( gstr, str );
|
||||||
g_free( str );
|
g_free( str );
|
||||||
g_string_append( gstr, st->isBackup ? "</i>" : "</b>" );
|
g_string_append( gstr, st->isBackup ? "</i>" : "</b>" );
|
||||||
|
|
|
@ -213,12 +213,16 @@ tr_tracker;
|
||||||
static char *
|
static char *
|
||||||
getKey( const char * url )
|
getKey( const char * url )
|
||||||
{
|
{
|
||||||
int port = 0;
|
|
||||||
char * host = NULL;
|
|
||||||
char * ret;
|
char * ret;
|
||||||
tr_urlParse( url, -1, NULL, &host, &port, NULL );
|
char * scheme = NULL;
|
||||||
ret = tr_strdup_printf( "%s:%d", ( host ? host : "invalid" ), port );
|
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( host );
|
||||||
|
tr_free( scheme );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue