Browse Source

show streams from all streaming destinations

pull/468/head
orignal 9 years ago
parent
commit
941f30d1ea
  1. 14
      Destination.cpp
  2. 1
      Destination.h
  3. 22
      HTTPServer.cpp

14
Destination.cpp

@ -780,5 +780,19 @@ namespace client @@ -780,5 +780,19 @@ namespace client
}
LogPrint(eLogError, "Destinations: Can't save keys to ", path);
}
std::vector<std::shared_ptr<const i2p::stream::Stream> > ClientDestination::GetAllStreams () const
{
std::vector<std::shared_ptr<const i2p::stream::Stream> > ret;
if (m_StreamingDestination)
{
for (auto& it: m_StreamingDestination->GetStreams ())
ret.push_back (it.second);
}
for (auto& it: m_StreamingDestinationsByPorts)
for (auto& it1: it.second->GetStreams ())
ret.push_back (it1.second);
return ret;
}
}
}

1
Destination.h

@ -159,6 +159,7 @@ namespace client @@ -159,6 +159,7 @@ namespace client
// for HTTP only
int GetNumRemoteLeaseSets () const { return m_RemoteLeaseSets.size (); };
std::vector<std::shared_ptr<const i2p::stream::Stream> > GetAllStreams () const;
};
}
}

22
HTTPServer.cpp

@ -609,19 +609,19 @@ namespace util @@ -609,19 +609,19 @@ namespace util
s << "<th>Status</th>";
s << "</tr>";
for (auto it: dest->GetStreamingDestination ()->GetStreams ())
for (auto it: dest->GetAllStreams ())
{
s << "<tr>";
s << "<td>" << it.first << "</td>";
s << "<td>" << i2p::client::context.GetAddressBook ().ToAddress(it.second->GetRemoteIdentity ()) << "</td>";
s << "<td>" << it.second->GetNumSentBytes () << "</td>";
s << "<td>" << it.second->GetNumReceivedBytes () << "</td>";
s << "<td>" << it.second->GetSendQueueSize () << "</td>";
s << "<td>" << it.second->GetReceiveQueueSize () << "</td>";
s << "<td>" << it.second->GetSendBufferSize () << "</td>";
s << "<td>" << it.second->GetRTT () << "</td>";
s << "<td>" << it.second->GetWindowSize () << "</td>";
s << "<td>" << (int)it.second->GetStatus () << "</td>";
s << "<td>" << it->GetSendStreamID () << "</td>";
s << "<td>" << i2p::client::context.GetAddressBook ().ToAddress(it->GetRemoteIdentity ()) << "</td>";
s << "<td>" << it->GetNumSentBytes () << "</td>";
s << "<td>" << it->GetNumReceivedBytes () << "</td>";
s << "<td>" << it->GetSendQueueSize () << "</td>";
s << "<td>" << it->GetReceiveQueueSize () << "</td>";
s << "<td>" << it->GetSendBufferSize () << "</td>";
s << "<td>" << it->GetRTT () << "</td>";
s << "<td>" << it->GetWindowSize () << "</td>";
s << "<td>" << (int)it->GetStatus () << "</td>";
s << "</tr><br>\r\n" << std::endl;
}
}

Loading…
Cancel
Save