]> granicus.if.org Git - transmission/commitdiff
(trunk daemon) #3284 "show bandwidth priorities in transmission-remote" -- added
authorCharles Kerr <charles@transmissionbt.com>
Sat, 26 Jun 2010 20:48:52 +0000 (20:48 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Sat, 26 Jun 2010 20:48:52 +0000 (20:48 +0000)
daemon/remote.c

index 2f83c5432dc75c7afcc234d44107ef65aed509fc..7c9a2e18f84e9322848645ea2802d02065e209a3 100644 (file)
@@ -587,6 +587,7 @@ static const char * files_keys[] = {
 static const char * details_keys[] = {
     "activityDate",
     "addedDate",
+    "bandwidthPriority",
     "comment",
     "corruptEver",
     "creator",
@@ -749,6 +750,9 @@ getStatusString( tr_benc * t, char * buf, size_t buflen )
     return buf;
 }
 
+static const char *bandwidthPriorityNames[] =
+    { "Low", "Normal", "High", "Invalid" };
+
 static void
 printDetails( tr_benc * top )
 {
@@ -1067,7 +1071,7 @@ printDetails( tr_benc * top )
                 printf( "  Piece Size: %" PRId64 "\n", i );
             printf( "\n" );
 
-            printf( "LIMITS\n" );
+            printf( "LIMITS & BANDWIDTH\n" );
             if( tr_bencDictFindBool( t, "downloadLimited", &boolVal )
                 && tr_bencDictFindInt( t, "downloadLimit", &i ) )
             {
@@ -1090,6 +1094,10 @@ printDetails( tr_benc * top )
                 printf( "  Honors Session Limits: %s\n", ( boolVal ? "Yes" : "No" ) );
             if( tr_bencDictFindInt ( t, "peer-limit", &i ) )
                 printf( "  Peer limit: %" PRId64 "\n", i );
+            if (tr_bencDictFindInt (t, "bandwidthPriority", &i))
+                printf ("  Bandwidth Priority: %s\n",
+                        bandwidthPriorityNames[(i + 1) & 3]);
+   
             printf( "\n" );
 
             printf( "PIECES\n" );