Commit bef2eb80 authored by gejun's avatar gejun

Show status of agent_sock on /connections

parent 349f9087
...@@ -187,13 +187,19 @@ void ConnectionsService::PrintConnections( ...@@ -187,13 +187,19 @@ void ConnectionsService::PrintConnections(
<< min_width("-", 8) << bar << min_width("-", 8) << bar
<< min_width("-", 11) << bar; << min_width("-", 11) << bar;
} else { } else {
{
SocketUniquePtr agent_sock;
if (ptr->PeekAgentSocket(&agent_sock) == 0) {
ptr.swap(agent_sock);
}
}
// Get name of the protocol. In principle we can dynamic_cast the // Get name of the protocol. In principle we can dynamic_cast the
// socket user to InputMessenger but I'm not sure if that's a bit // socket user to InputMessenger but I'm not sure if that's a bit
// slow (because we have many connections here). // slow (because we have many connections here).
int pref_index = ptr->preferred_index(); int pref_index = ptr->preferred_index();
SocketUniquePtr first_sub; SocketUniquePtr first_sub;
int pooled_count = -1; int pooled_count = -1;
if (ptr->fd() < 0) { if (ptr->HasSocketPool()) {
int numfree = 0; int numfree = 0;
int numinflight = 0; int numinflight = 0;
if (ptr->GetPooledSocketStats(&numfree, &numinflight)) { if (ptr->GetPooledSocketStats(&numfree, &numinflight)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment