MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / StatusCommandHandler

Method StatusCommandHandler

libi2pd_client/BOB.cpp:942–969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

940 }
941
942 void BOBCommandSession::StatusCommandHandler (const char * operand, size_t len)
943 {
944 LogPrint (eLogDebug, "BOB: status ", operand);
945 const std::string name = operand;
946 std::string statusLine;
947
948 // always prefer destination
949 auto dest = m_Owner.FindDestination(name);
950 if(dest)
951 {
952 // tunnel destination exists
953 BuildStatusLine(false, dest, statusLine);
954 SendReplyOK(statusLine);
955 }
956 else
957 {
958 if(m_Nickname == name && !name.empty())
959 {
960 // tunnel is incomplete / has not been started yet
961 BuildStatusLine(true, nullptr, statusLine);
962 SendReplyOK(statusLine);
963 }
964 else
965 {
966 SendReplyError("no nickname has been set");
967 }
968 }
969 }
970 void BOBCommandSession::HelpCommandHandler (const char * operand, size_t len)
971 {
972 auto helpStrings = m_Owner.GetHelpStrings();

Callers

nothing calls this directly

Calls 2

LogPrintFunction · 0.85
FindDestinationMethod · 0.80

Tested by

no test coverage detected