mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-09 19:47:54 +00:00
handle status command
This commit is contained in:
parent
ecc82739d8
commit
e1bf53d90a
10
BOB.cpp
10
BOB.cpp
@ -545,6 +545,15 @@ namespace client
|
|||||||
else
|
else
|
||||||
SendReplyError ("malformed");
|
SendReplyError ("malformed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BOBCommandSession::StatusCommandHandler (const char * operand, size_t len)
|
||||||
|
{
|
||||||
|
LogPrint (eLogDebug, "BOB: status ", operand);
|
||||||
|
if (m_Owner.FindDestination (operand))
|
||||||
|
SendReplyOK ("")
|
||||||
|
else
|
||||||
|
SendReplyError ("no nickname has been set");
|
||||||
|
}
|
||||||
|
|
||||||
BOBCommandChannel::BOBCommandChannel (const std::string& address, int port):
|
BOBCommandChannel::BOBCommandChannel (const std::string& address, int port):
|
||||||
m_IsRunning (false), m_Thread (nullptr),
|
m_IsRunning (false), m_Thread (nullptr),
|
||||||
@ -570,6 +579,7 @@ namespace client
|
|||||||
m_CommandHandlers[BOB_COMMAND_CLEAR] = &BOBCommandSession::ClearCommandHandler;
|
m_CommandHandlers[BOB_COMMAND_CLEAR] = &BOBCommandSession::ClearCommandHandler;
|
||||||
m_CommandHandlers[BOB_COMMAND_LIST] = &BOBCommandSession::ListCommandHandler;
|
m_CommandHandlers[BOB_COMMAND_LIST] = &BOBCommandSession::ListCommandHandler;
|
||||||
m_CommandHandlers[BOB_COMMAND_OPTION] = &BOBCommandSession::OptionCommandHandler;
|
m_CommandHandlers[BOB_COMMAND_OPTION] = &BOBCommandSession::OptionCommandHandler;
|
||||||
|
m_CommandHandlers[BOB_COMMAND_STATUS] = &BOBCommandSession::StatusCommandHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOBCommandChannel::~BOBCommandChannel ()
|
BOBCommandChannel::~BOBCommandChannel ()
|
||||||
|
2
BOB.h
2
BOB.h
@ -36,6 +36,7 @@ namespace client
|
|||||||
const char BOB_COMMAND_CLEAR[] = "clear";
|
const char BOB_COMMAND_CLEAR[] = "clear";
|
||||||
const char BOB_COMMAND_LIST[] = "list";
|
const char BOB_COMMAND_LIST[] = "list";
|
||||||
const char BOB_COMMAND_OPTION[] = "option";
|
const char BOB_COMMAND_OPTION[] = "option";
|
||||||
|
const char BOB_COMMAND_STATUS[] = "status";
|
||||||
|
|
||||||
const char BOB_VERSION[] = "BOB 00.00.10\nOK\n";
|
const char BOB_VERSION[] = "BOB 00.00.10\nOK\n";
|
||||||
const char BOB_REPLY_OK[] = "OK %s\n";
|
const char BOB_REPLY_OK[] = "OK %s\n";
|
||||||
@ -170,6 +171,7 @@ namespace client
|
|||||||
void ClearCommandHandler (const char * operand, size_t len);
|
void ClearCommandHandler (const char * operand, size_t len);
|
||||||
void ListCommandHandler (const char * operand, size_t len);
|
void ListCommandHandler (const char * operand, size_t len);
|
||||||
void OptionCommandHandler (const char * operand, size_t len);
|
void OptionCommandHandler (const char * operand, size_t len);
|
||||||
|
void StatusCommandHandler (const char * operand, size_t len);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user