Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ exe dht-bootstrap
<threading>multi
<include>src
<library>boost-system
<toolset>gcc:<cxxflags>-std=c++11
<toolset>darwin:<cxxflags>-std=c++11
: # default build
<link>static
<threading>multi
<cxxstd>14
: # usage requirements
;

Expand All @@ -35,11 +34,10 @@ exe dht-torture
<threading>multi
<include>src
<library>boost-system
<toolset>gcc:<cxxflags>-std=c++11
<toolset>darwin:<cxxflags>-std=c++11
: # default build
<link>static
<threading>multi
<cxxstd>14
: # usage requirements
;

Expand Down
5 changes: 3 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,12 @@ void print_stats(steady_timer& stats_timer, error_code const& ec)
}
client_histogram.clear();
}
std::sort(ordered.begin(), ordered.end());
char client_dist[200];
std::sort(ordered.begin(), ordered.end(), std::greater<>{});
char client_dist[250];
client_dist[0] = '\0';
int len = 0;
for (auto i : ordered) {
if (len > sizeof(client_dist) - 10) break;
len += snprintf(client_dist + len, sizeof(client_dist) - len
, "[%c%c: %d] ", (i.second >> 8) & 0xff, i.second & 0xff, i.first);
}
Expand Down