mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
BOB: fix status command.
This commit is contained in:
parent
a23e845c03
commit
b759294975
|
@ -691,21 +691,23 @@ namespace client
|
||||||
void BOBCommandSession::StatusCommandHandler (const char * operand, size_t len)
|
void BOBCommandSession::StatusCommandHandler (const char * operand, size_t len)
|
||||||
{
|
{
|
||||||
LogPrint (eLogDebug, "BOB: status ", operand);
|
LogPrint (eLogDebug, "BOB: status ", operand);
|
||||||
|
const std::string name = operand;
|
||||||
std::string statusLine;
|
std::string statusLine;
|
||||||
if (m_Nickname == operand)
|
|
||||||
|
// always prefer destination
|
||||||
|
auto ptr = m_Owner.FindDestination(name);
|
||||||
|
if(ptr != nullptr)
|
||||||
{
|
{
|
||||||
// check current tunnel
|
// tunnel destination exists
|
||||||
BuildStatusLine(true, nullptr, statusLine);
|
BuildStatusLine(false, ptr, statusLine);
|
||||||
SendReplyOK(statusLine.c_str());
|
SendReplyOK(statusLine.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// check other
|
if(m_Nickname == name && !name.empty())
|
||||||
std::string name = operand;
|
|
||||||
auto ptr = m_Owner.FindDestination(name);
|
|
||||||
if(ptr != nullptr)
|
|
||||||
{
|
{
|
||||||
BuildStatusLine(false, ptr, statusLine);
|
// tunnel is incomplete / has not been started yet
|
||||||
|
BuildStatusLine(true, nullptr, statusLine);
|
||||||
SendReplyOK(statusLine.c_str());
|
SendReplyOK(statusLine.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue