|
|
|
@ -284,7 +284,7 @@ namespace client
@@ -284,7 +284,7 @@ namespace client
|
|
|
|
|
std::placeholders::_1, std::placeholders::_2)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::HandleSent (const boost::system::error_code& ecode, std::size_t bytes_transferred) |
|
|
|
|
void BOBCommandSession::HandleSent (const boost::system::error_code& ecode, std::size_t /*bytes_transferred*/) |
|
|
|
|
{ |
|
|
|
|
if (ecode) |
|
|
|
|
{ |
|
|
|
@ -338,20 +338,20 @@ namespace client
@@ -338,20 +338,20 @@ namespace client
|
|
|
|
|
Send (len); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::ZapCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::ZapCommandHandler (const char * /*operand*/, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: zap"); |
|
|
|
|
Terminate (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::QuitCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::QuitCommandHandler (const char * /*operand*/, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: quit"); |
|
|
|
|
m_IsOpen = false; |
|
|
|
|
SendReplyOK ("Bye!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::StartCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::StartCommandHandler (const char * /*operand*/, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: start ", m_Nickname); |
|
|
|
|
if (m_IsActive) |
|
|
|
@ -373,7 +373,7 @@ namespace client
@@ -373,7 +373,7 @@ namespace client
|
|
|
|
|
m_IsActive = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::StopCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::StopCommandHandler (const char * /*operand*/, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: stop ", m_Nickname); |
|
|
|
|
if (!m_IsActive) |
|
|
|
@ -392,7 +392,7 @@ namespace client
@@ -392,7 +392,7 @@ namespace client
|
|
|
|
|
m_IsActive = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::SetNickCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::SetNickCommandHandler (const char * operand, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: setnick ", operand); |
|
|
|
|
m_Nickname = operand; |
|
|
|
@ -401,7 +401,7 @@ namespace client
@@ -401,7 +401,7 @@ namespace client
|
|
|
|
|
SendReplyOK (msg.c_str ()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::GetNickCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::GetNickCommandHandler (const char * operand, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: getnick ", operand); |
|
|
|
|
m_CurrentDestination = m_Owner.FindDestination (operand); |
|
|
|
@ -420,40 +420,40 @@ namespace client
@@ -420,40 +420,40 @@ namespace client
|
|
|
|
|
SendReplyError ("no nickname has been set"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::NewkeysCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::NewkeysCommandHandler (const char* /*operand*/, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: newkeys"); |
|
|
|
|
m_Keys = i2p::data::PrivateKeys::CreateRandomKeys (); |
|
|
|
|
SendReplyOK (m_Keys.GetPublic ()->ToBase64 ().c_str ()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::SetkeysCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::SetkeysCommandHandler (const char* operand, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: setkeys ", operand); |
|
|
|
|
m_Keys.FromBase64 (operand); |
|
|
|
|
SendReplyOK (m_Keys.GetPublic ()->ToBase64 ().c_str ()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::GetkeysCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::GetkeysCommandHandler (const char* /*operand*/, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: getkeys"); |
|
|
|
|
SendReplyOK (m_Keys.ToBase64 ().c_str ()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::GetdestCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::GetdestCommandHandler (const char* /*operand*/, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: getdest"); |
|
|
|
|
SendReplyOK (m_Keys.GetPublic ()->ToBase64 ().c_str ()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::OuthostCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::OuthostCommandHandler (const char* operand, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: outhost ", operand); |
|
|
|
|
m_Address = operand; |
|
|
|
|
SendReplyOK ("outhost set"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::OutportCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::OutportCommandHandler (const char* operand, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: outport ", operand); |
|
|
|
|
m_OutPort = boost::lexical_cast<int>(operand); |
|
|
|
@ -463,14 +463,14 @@ namespace client
@@ -463,14 +463,14 @@ namespace client
|
|
|
|
|
SendReplyError ("port out of range"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::InhostCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::InhostCommandHandler (const char* operand, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: inhost ", operand); |
|
|
|
|
m_Address = operand; |
|
|
|
|
SendReplyOK ("inhost set"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::InportCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::InportCommandHandler (const char* operand, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: inport ", operand); |
|
|
|
|
m_InPort = boost::lexical_cast<int>(operand); |
|
|
|
@ -480,7 +480,7 @@ namespace client
@@ -480,7 +480,7 @@ namespace client
|
|
|
|
|
SendReplyError ("port out of range"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::QuietCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::QuietCommandHandler (const char* /*operand*/, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: quiet"); |
|
|
|
|
if (m_Nickname.length () > 0) |
|
|
|
@ -497,7 +497,7 @@ namespace client
@@ -497,7 +497,7 @@ namespace client
|
|
|
|
|
SendReplyError ("no nickname has been set"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::LookupCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::LookupCommandHandler (const char* operand, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: lookup ", operand); |
|
|
|
|
i2p::data::IdentHash ident; |
|
|
|
@ -525,7 +525,7 @@ namespace client
@@ -525,7 +525,7 @@ namespace client
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::ClearCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::ClearCommandHandler (const char* /*operand*/, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: clear"); |
|
|
|
|
m_Owner.DeleteDestination (m_Nickname); |
|
|
|
@ -533,7 +533,7 @@ namespace client
@@ -533,7 +533,7 @@ namespace client
|
|
|
|
|
SendReplyOK ("cleared"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::ListCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::ListCommandHandler (const char* /*operand*/, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: list"); |
|
|
|
|
const auto& destinations = m_Owner.GetDestinations (); |
|
|
|
@ -542,7 +542,7 @@ namespace client
@@ -542,7 +542,7 @@ namespace client
|
|
|
|
|
SendReplyOK ("Listing done"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::OptionCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::OptionCommandHandler (const char* operand, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: option ", operand); |
|
|
|
|
const char * value = strchr (operand, '='); |
|
|
|
@ -561,7 +561,7 @@ namespace client
@@ -561,7 +561,7 @@ namespace client
|
|
|
|
|
SendReplyError ("malformed"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void BOBCommandSession::StatusCommandHandler (const char * operand, size_t len) |
|
|
|
|
void BOBCommandSession::StatusCommandHandler (const char* operand, size_t /*len*/) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "BOB: status ", operand); |
|
|
|
|
if (m_Nickname == operand) |
|
|
|
|