1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-02-02 02:44:15 +00:00

populate session keys

This commit is contained in:
orignal 2014-12-04 19:29:20 -05:00
parent 4c8d85870b
commit e84d4e5f42

16
BOB.cpp
View File

@ -18,6 +18,7 @@ namespace client
BOBI2PInboundTunnel::~BOBI2PInboundTunnel () BOBI2PInboundTunnel::~BOBI2PInboundTunnel ()
{ {
Stop ();
} }
void BOBI2PInboundTunnel::Start () void BOBI2PInboundTunnel::Start ()
@ -153,7 +154,8 @@ namespace client
if (ecode) if (ecode)
{ {
LogPrint ("BOB command channel read error: ", ecode.message ()); LogPrint ("BOB command channel read error: ", ecode.message ());
Terminate (); if (ecode != boost::asio::error::operation_aborted)
Terminate ();
} }
else else
{ {
@ -208,7 +210,8 @@ namespace client
if (ecode) if (ecode)
{ {
LogPrint ("BOB command channel send error: ", ecode.message ()); LogPrint ("BOB command channel send error: ", ecode.message ());
Terminate (); if (ecode != boost::asio::error::operation_aborted)
Terminate ();
} }
else else
{ {
@ -277,6 +280,7 @@ namespace client
if (tunnel) if (tunnel)
{ {
tunnel->Stop (); tunnel->Stop ();
tunnel->GetLocalDestination ()->Stop ();
SendReplyOK ("tunnel stopping"); SendReplyOK ("tunnel stopping");
} }
else else
@ -287,7 +291,7 @@ namespace client
{ {
LogPrint (eLogDebug, "BOB: setnick"); LogPrint (eLogDebug, "BOB: setnick");
m_Nickname = operand; m_Nickname = operand;
std::string msg ("Nickname set to"); std::string msg ("Nickname set to ");
msg += operand; msg += operand;
SendReplyOK (msg.c_str ()); SendReplyOK (msg.c_str ());
} }
@ -295,10 +299,12 @@ namespace client
void BOBCommandSession::GetNickCommandHandler (const char * operand, size_t len) void BOBCommandSession::GetNickCommandHandler (const char * operand, size_t len)
{ {
LogPrint (eLogDebug, "BOB: getnick"); LogPrint (eLogDebug, "BOB: getnick");
if (m_Owner.FindTunnel (operand)) auto tunnel = m_Owner.FindTunnel (operand);
if (tunnel)
{ {
m_Keys = tunnel->GetLocalDestination ()->GetPrivateKeys ();
m_Nickname = operand; m_Nickname = operand;
std::string msg ("Nickname set to"); std::string msg ("Nickname set to ");
msg += operand; msg += operand;
SendReplyOK (msg.c_str ()); SendReplyOK (msg.c_str ());
} }