Browse Source

don't allow STREAM CONNECT and STREAM ACCEPT in command session

pull/1575/head
orignal 4 years ago
parent
commit
5d256e1d80
  1. 10
      libi2pd_client/SAM.cpp

10
libi2pd_client/SAM.cpp

@ -472,6 +472,11 @@ namespace client
void SAMSocket::ProcessStreamConnect (char * buf, size_t len, size_t rem) void SAMSocket::ProcessStreamConnect (char * buf, size_t len, size_t rem)
{ {
LogPrint (eLogDebug, "SAM: stream connect: ", buf); LogPrint (eLogDebug, "SAM: stream connect: ", buf);
if ( m_SocketType != eSAMSocketTypeUnknown)
{
SendI2PError ("Socket already in use");
return;
}
std::map<std::string, std::string> params; std::map<std::string, std::string> params;
ExtractParams (buf, params); ExtractParams (buf, params);
std::string& id = params[SAM_PARAM_ID]; std::string& id = params[SAM_PARAM_ID];
@ -547,6 +552,11 @@ namespace client
void SAMSocket::ProcessStreamAccept (char * buf, size_t len) void SAMSocket::ProcessStreamAccept (char * buf, size_t len)
{ {
LogPrint (eLogDebug, "SAM: stream accept: ", buf); LogPrint (eLogDebug, "SAM: stream accept: ", buf);
if ( m_SocketType != eSAMSocketTypeUnknown)
{
SendI2PError ("Socket already in use");
return;
}
std::map<std::string, std::string> params; std::map<std::string, std::string> params;
ExtractParams (buf, params); ExtractParams (buf, params);
std::string& id = params[SAM_PARAM_ID]; std::string& id = params[SAM_PARAM_ID];

Loading…
Cancel
Save