From 7c5140f473f04e23fbdb824c71b988d7a4f27893 Mon Sep 17 00:00:00 2001 From: P2P-Next Date: Wed, 11 Aug 2010 20:15:56 +0300 Subject: [PATCH] instrumentation/hrktorrent: add basic functionality for retrieving peer-specific information --- instrumentation/hrktorrent/core.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/instrumentation/hrktorrent/core.cpp b/instrumentation/hrktorrent/core.cpp index 623a979..2295407 100644 --- a/instrumentation/hrktorrent/core.cpp +++ b/instrumentation/hrktorrent/core.cpp @@ -78,6 +78,9 @@ CCore::StatusLoop(void* data) int eta = 0, columns = 0, loopcount = 0; bool stdout_is_tty = false; + /* peer_info array for storing peer-specific information */ + std::vector peers; + stdout_is_tty = (isatty(STDOUT_FILENO) == 1); if (stdout_is_tty) { if(ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) < 0) { @@ -98,6 +101,7 @@ CCore::StatusLoop(void* data) Core->VerbosePrint("Core", "Reannouncing!\n"); } + /* build standard status message */ sstatus = s->status(); tstatus = t->status(); eta = GetETA(tstatus.total_done, tstatus.total_wanted, (libtorrent::size_type)sstatus.download_rate); @@ -138,6 +142,9 @@ CCore::StatusLoop(void* data) PrintStatusStream(output, columns, stdout_is_tty); output.str(""); + /* build peer status message */ + t->get_peer_info(peers); + sleep(1); loopcount++; } -- 2.20.1