mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-23 04:21:37 +00:00
decline master session if SAM version is less than 3.3
This commit is contained in:
1 parent
7dd174d32c
commit
83f9e1098d
2 files changed
+20
-1
No files matched your search
+19
-1
@@ -373,7 +373,15 @@ namespace client
|
||||
}
|
||||
}
|
||||
else if (style == SAM_VALUE_RAW) type = SAMSessionType::eSAMSessionTypeRaw;
|
||||
else if (style == SAM_VALUE_MASTER) type = SAMSessionType::eSAMSessionTypeMaster;
|
||||
else if (style == SAM_VALUE_MASTER)
|
||||
{
|
||||
if (m_Version < SAM_VERSION_33) // < SAM 3.3
|
||||
{
|
||||
SendSessionI2PError("MASTER session is not supported");
|
||||
return;
|
||||
}
|
||||
type = SAMSessionType::eSAMSessionTypeMaster;
|
||||
}
|
||||
if (type == SAMSessionType::eSAMSessionTypeUnknown)
|
||||
{
|
||||
// unknown style
|
||||
@@ -868,6 +876,11 @@ namespace client
|
||||
|
||||
void SAMSocket::ProcessSessionAdd (std::string_view buf)
|
||||
{
|
||||
if (m_Version < SAM_VERSION_33) // < SAM 3.3
|
||||
{
|
||||
SendSessionI2PError("SESSION ADD is not supported");
|
||||
return;
|
||||
}
|
||||
auto session = m_Owner.FindSession(m_ID);
|
||||
if (session && session->Type == SAMSessionType::eSAMSessionTypeMaster)
|
||||
{
|
||||
@@ -918,6 +931,11 @@ namespace client
|
||||
|
||||
void SAMSocket::ProcessSessionRemove (std::string_view buf)
|
||||
{
|
||||
if (m_Version < SAM_VERSION_33) // < SAM 3.3
|
||||
{
|
||||
SendSessionI2PError("SESSION REMOVE is not supported");
|
||||
return;
|
||||
}
|
||||
auto session = m_Owner.FindSession(m_ID);
|
||||
if (session && session->Type == SAMSessionType::eSAMSessionTypeMaster)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user