Browse Source

BOB 'clear' command

pull/113/head
orignal 10 years ago
parent
commit
8788e1b2fd
  1. 7
      BOB.cpp
  2. 2
      BOB.h

7
BOB.cpp

@ -435,6 +435,12 @@ namespace client
SendReplyOK (addr.ToBase64 ().c_str ()); SendReplyOK (addr.ToBase64 ().c_str ());
} }
void BOBCommandSession::ClearCommandHandler (const char * operand, size_t len)
{
LogPrint (eLogDebug, "BOB: clear");
// TODO
SendReplyOK ("cleared");
}
BOBCommandChannel::BOBCommandChannel (int port): BOBCommandChannel::BOBCommandChannel (int port):
m_IsRunning (false), m_Thread (nullptr), m_IsRunning (false), m_Thread (nullptr),
@ -457,6 +463,7 @@ namespace client
m_CommandHandlers[BOB_COMMAND_INPORT] = &BOBCommandSession::InportCommandHandler; m_CommandHandlers[BOB_COMMAND_INPORT] = &BOBCommandSession::InportCommandHandler;
m_CommandHandlers[BOB_COMMAND_QUIET] = &BOBCommandSession::QuietCommandHandler; m_CommandHandlers[BOB_COMMAND_QUIET] = &BOBCommandSession::QuietCommandHandler;
m_CommandHandlers[BOB_COMMAND_LOOKUP] = &BOBCommandSession::LookupCommandHandler; m_CommandHandlers[BOB_COMMAND_LOOKUP] = &BOBCommandSession::LookupCommandHandler;
m_CommandHandlers[BOB_COMMAND_CLEAR] = &BOBCommandSession::ClearCommandHandler;
} }
BOBCommandChannel::~BOBCommandChannel () BOBCommandChannel::~BOBCommandChannel ()

2
BOB.h

@ -32,6 +32,7 @@ namespace client
const char BOB_COMMAND_INPORT[] = "inport"; const char BOB_COMMAND_INPORT[] = "inport";
const char BOB_COMMAND_QUIET[] = "quiet"; const char BOB_COMMAND_QUIET[] = "quiet";
const char BOB_COMMAND_LOOKUP[] = "lookup"; const char BOB_COMMAND_LOOKUP[] = "lookup";
const char BOB_COMMAND_CLEAR[] = "clear";
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";
@ -121,6 +122,7 @@ namespace client
void InportCommandHandler (const char * operand, size_t len); void InportCommandHandler (const char * operand, size_t len);
void QuietCommandHandler (const char * operand, size_t len); void QuietCommandHandler (const char * operand, size_t len);
void LookupCommandHandler (const char * operand, size_t len); void LookupCommandHandler (const char * operand, size_t len);
void ClearCommandHandler (const char * operand, size_t len);
private: private:

Loading…
Cancel
Save