diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-24 08:07:59 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-24 08:07:59 +0000 |
commit | 5c448873776d720e2042e07932e77bea8f92c40d (patch) | |
tree | 2e9965eda6b460d0fa5c946d1bfaf3697f006b81 | |
parent | 0c3eaeaef58975e0e5ab57adc3a23b7dab142a89 (diff) |
Fix for atheme support (and others) which makes sure CAPAB is always sent before BURST
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7404 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_spanningtree/treesocket.h | 1 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 6 |
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> ¶ms) 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> ¶ms) this->InboundServerName = sname; this->InboundDescription = description; + if (!sentcapab) + this->SendCapabilities(); + if (hops) { this->SendError("Server too far away for authentication"); |