Changeset 7653
- Timestamp:
- Jan 10, 2009, 2:23:58 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/remote.c
r7552 r7653 720 720 } 721 721 722 static const char* 723 getTrackerDateStr( const time_t t, tr_bool isStopped ) 724 { 725 const char * str; 726 switch( t ) { 727 case 0: str = isStopped ? "None (Stopped)\n" : "None\n"; break; 728 case 1: str = "In Progress\n"; break; 729 default: str = ctime( &t ); break; 730 } 731 return str; 732 } 733 722 734 static void 723 735 printDetails( tr_benc * top ) … … 738 750 char buf2[512]; 739 751 int64_t i, j, k; 752 tr_bool isStopped; 753 754 isStopped = tr_bencDictFindInt( t, "status", &i ) && (i==TR_STATUS_STOPPED); 740 755 741 756 printf( "NAME\n" ); … … 851 866 852 867 printf( "TRACKER\n" ); 853 if( tr_bencDictFindInt( t, "lastAnnounceTime", &i ) && i ) 854 { 855 const time_t tt = i; 856 printf( " Latest announce: %s", ctime( &tt ) ); 857 } 868 if( tr_bencDictFindInt( t, "lastAnnounceTime", &i ) ) 869 printf( " Latest announce: %s", getTrackerDateStr( (time_t)i, isStopped ) ); 858 870 if( tr_bencDictFindStr( t, "announceURL", &str ) ) 859 871 printf( " Announce URL: %s\n", str ); 860 if( tr_bencDictFindStr( t, "announceResponse", 861 &str ) && str && *str ) 872 if( tr_bencDictFindStr( t, "announceResponse", &str ) && str && *str ) 862 873 printf( " Announce response: %s\n", str ); 863 if( tr_bencDictFindInt( t, "nextAnnounceTime", &i ) && i ) 864 { 865 const time_t tt = i; 866 printf( " Next announce: %s", ctime( &tt ) ); 867 } 868 if( tr_bencDictFindInt( t, "lastScrapeTime", &i ) && i ) 869 { 870 const time_t tt = i; 871 printf( " Latest scrape: %s", ctime( &tt ) ); 872 } 874 if( tr_bencDictFindInt( t, "nextAnnounceTime", &i ) ) 875 printf( " Next announce: %s", getTrackerDateStr( (time_t)i, isStopped ) ); 876 if( tr_bencDictFindInt( t, "lastScrapeTime", &i ) ) 877 printf( " Latest scrape: %s", getTrackerDateStr( (time_t)i, isStopped ) ); 873 878 if( tr_bencDictFindStr( t, "scrapeResponse", &str ) ) 874 879 printf( " Scrape response: %s\n", str ); 875 if( tr_bencDictFindInt( t, "nextScrapeTime", &i ) && i ) 876 { 877 const time_t tt = i; 878 printf( " Next scrape: %s", ctime( &tt ) ); 879 } 880 if( tr_bencDictFindInt( t, "seeders", &i ) 881 && tr_bencDictFindInt( t, "leechers", &j ) ) 882 printf( 883 " Tracker knows of %" PRId64 " seeders and %" PRId64 884 " leechers\n", i, j ); 880 if( tr_bencDictFindInt( t, "nextScrapeTime", &i ) ) 881 printf( " Next scrape: %s", getTrackerDateStr( (time_t)i, isStopped ) ); 882 if( tr_bencDictFindInt( t, "seeders", &i ) && tr_bencDictFindInt( t, "leechers", &j ) ) 883 printf( " Tracker knows of %" PRId64 " seeders and %" PRId64 " leechers\n", i, j ); 885 884 if( tr_bencDictFindInt( t, "timesCompleted", &i ) ) 886 printf( 887 " Tracker has seen %" PRId64 888 " clients complete this torrent\n", i ); 885 printf( " Tracker has seen %" PRId64 " clients complete this torrent\n", i ); 889 886 printf( "\n" ); 890 887
Note: See TracChangeset
for help on using the changeset viewer.