summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-09 15:55:06 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-09 15:55:06 +0000
commita22c47d19a9388c051dd96d711a0e4a4ef8a8b81 (patch)
tree2b1e1136c1d8619671707dcea3928e9da524b17a /src
parent8eec77bdde05b5e8503a5c19a7c40c60473e21cf (diff)
This is likely fucked up beyond all recognition. Today is fubar day :p
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6772 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/handshaketimer.cpp2
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp8
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp3
3 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/handshaketimer.cpp b/src/modules/m_spanningtree/handshaketimer.cpp
index a82ea7ea0..652390750 100644
--- a/src/modules/m_spanningtree/handshaketimer.cpp
+++ b/src/modules/m_spanningtree/handshaketimer.cpp
@@ -53,7 +53,7 @@ void HandshakeTimer::Tick(time_t TIME)
{
InspSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send();
sock->SendCapabilities();
- if (sock->GetLinkState() == CONNECTING)
+ if ((sock->GetLinkState() == CONNECTING) && (sock->GetOurChallenge().empty()))
sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+sock->MakePass(lnk->SendPass, sock->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
}
else
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index b0a7e3205..2ce296001 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -173,8 +173,6 @@ bool TreeSocket::OnConnected()
InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send();
this->Instance->SNO->WriteToSnoMask('l',"Connection to \2"+myhost+"\2["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] using transport \2"+x->Hook+"\2");
}
- else
- this->SendCapabilities();
/* found who we're supposed to be connecting to, send the neccessary gubbins. */
Instance->Timers->AddTimer(new HandshakeTimer(Instance, this, &(*x), this->Utils));
return true;
@@ -414,6 +412,12 @@ bool TreeSocket::Capab(const std::deque<std::string> &params)
{
/* Challenge-response is on now */
this->SetTheirChallenge(n->second);
+ if (!this->GetOurChallenge().empty() && (this->LinkState == CONNECTING))
+ {
+ Link* lnk = Utils->FindLink(this->myhost.c_str());
+ if (lnk)
+ this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(lnk->SendPass, this->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
+ }
}
if (reason.length())
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 1aa4fc8c7..8c332dc63 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -902,7 +902,8 @@ bool TreeSocket::Inbound_Server(std::deque<std::string> &params)
this->InboundDescription = description;
// this is good. Send our details: Our server name and description and hopcount of 0,
// along with the sendpass from this block.
- this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
+ if (this->GetOurChallenge().empty())
+ this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
// move to the next state, we are now waiting for THEM.
this->LinkState = WAIT_AUTH_2;
return true;