summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_spanningtree/treesocket.h1
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp6
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp6
3 files changed, 13 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h
index cbf3c0812..fae22638d 100644
--- a/src/modules/m_spanningtree/treesocket.h
+++ b/src/modules/m_spanningtree/treesocket.h
@@ -95,6 +95,7 @@ class TreeSocket : public InspSocket
std::string ourchallenge; /* Challenge sent for challenge/response */
std::string theirchallenge; /* Challenge recv for challenge/response */
std::string OutboundPass; /* Outbound password */
+ bool sentcapab; /* Have sent CAPAB already */
public:
/** Because most of the I/O gubbins are encapsulated within
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 0739e8152..a23d55555 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -73,6 +73,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, int newfd, cha
this->LinkState = WAIT_AUTH_1;
theirchallenge.clear();
ourchallenge.clear();
+ sentcapab = false;
/* If we have a transport module hooked to the parent, hook the same module to this
* socket, and set a timer waiting for handshake before we send CAPAB etc.
*/
@@ -186,6 +187,7 @@ bool TreeSocket::OnConnected()
this->Instance->SNO->WriteToSnoMask('l',"Connection to \2"+myhost+"\2["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] using transport \2"+x->Hook+"\2");
}
this->OutboundPass = x->SendPass;
+ sentcapab = false;
/* found who we're supposed to be connecting to, send the neccessary gubbins. */
if (this->GetHook())
@@ -328,6 +330,10 @@ std::string TreeSocket::RandString(unsigned int length)
void TreeSocket::SendCapabilities()
{
+ if (sentcapab)
+ return;
+
+ sentcapab = true;
irc::commasepstream modulelist(MyCapabilities());
this->WriteLine("CAPAB START");
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index d13ea0d89..86a00a241 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -803,6 +803,9 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> &params)
this->InboundServerName = sname;
this->InboundDescription = description;
+ if (!sentcapab)
+ this->SendCapabilities();
+
if (hops)
{
this->SendError("Server too far away for authentication");
@@ -856,6 +859,9 @@ bool TreeSocket::Inbound_Server(std::deque<std::string> &params)
this->InboundServerName = sname;
this->InboundDescription = description;
+ if (!sentcapab)
+ this->SendCapabilities();
+
if (hops)
{
this->SendError("Server too far away for authentication");