From 5c448873776d720e2042e07932e77bea8f92c40d Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 24 Jun 2007 08:07:59 +0000 Subject: 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 --- src/modules/m_spanningtree/treesocket.h | 1 + src/modules/m_spanningtree/treesocket1.cpp | 6 ++++++ src/modules/m_spanningtree/treesocket2.cpp | 6 ++++++ 3 files changed, 13 insertions(+) (limited to 'src/modules') 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 ? "" : 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 ¶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 ¶ms) this->InboundServerName = sname; this->InboundDescription = description; + if (!sentcapab) + this->SendCapabilities(); + if (hops) { this->SendError("Server too far away for authentication"); -- cgit v1.2.3