summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-03 18:23:04 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-03 18:23:04 +0000
commitab4b307b744f3602512fd2ab126c5f4f4a2173db (patch)
treeb977b10bf472449483655e626c6f820968cfc221 /src/modules
parente27b8377a0c2ae6855d680f6b2eb44dc093813fc (diff)
Clean up duplicated link snomask messages on errors
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11999 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/treesocket.h2
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp8
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp9
3 files changed, 7 insertions, 12 deletions
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h
index 34390f9d0..c71799343 100644
--- a/src/modules/m_spanningtree/treesocket.h
+++ b/src/modules/m_spanningtree/treesocket.h
@@ -256,7 +256,7 @@ class TreeSocket : public BufferedSocket
void WriteLine(std::string line);
/** Handle ERROR command */
- bool Error(parameterlist &params);
+ void Error(parameterlist &params);
/** remote MOTD. */
bool Motd(const std::string &prefix, parameterlist &params);
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 9d3de187d..fcd6871e1 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -72,19 +72,19 @@ found:
TreeSocket::TreeSocket(SpanningTreeUtilities* Util, int newfd, ListenSocket* via, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server)
: BufferedSocket(newfd), Utils(Util)
{
- int dummy;
- irc::sockets::satoap(*client, IP, dummy);
+ IP = client->addr();
age = ServerInstance->Time();
LinkState = WAIT_AUTH_1;
capab_phase = 0;
proto_version = 0;
+ myhost = "inbound from " + IP;
FOREACH_MOD(I_OnHookIO, OnHookIO(this, via));
if (GetIOHook())
GetIOHook()->OnStreamSocketAccept(this, client, server);
SendCapabilities(1);
- Utils->timeoutlist[this] = std::pair<std::string, int>("inbound from " + IP, 30);
+ Utils->timeoutlist[this] = std::pair<std::string, int>(myhost, 30);
}
ServerState TreeSocket::GetLinkState()
@@ -155,8 +155,6 @@ void TreeSocket::SendError(const std::string &errormessage)
{
WriteLine("ERROR :"+errormessage);
SetError(errormessage);
- /* Display the error locally as well as sending it remotely */
- ServerInstance->SNO->WriteGlobalSno('l', "Sent \2ERROR\2 to %s: %s", (this->InboundServerName.empty() ? this->IP.c_str() : this->InboundServerName.c_str()), errormessage.c_str());
}
/** This function forces this server to quit, removing this server
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 918ce2164..350531f46 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -24,13 +24,10 @@
#include "resolvers.h"
/* Handle ERROR command */
-bool TreeSocket::Error(parameterlist &params)
+void TreeSocket::Error(parameterlist &params)
{
- if (params.size() < 1)
- return false;
- ServerInstance->SNO->WriteGlobalSno('l',"ERROR from %s: %s",(!InboundServerName.empty() ? InboundServerName.c_str() : myhost.c_str()),params[0].c_str());
- /* we will return false to cause the socket to close. */
- return false;
+ std::string msg = params.size() ? params[0] : "";
+ SetError("received ERROR " + msg);
}
void TreeSocket::Split(const std::string& line, std::string& prefix, std::string& command, parameterlist& params)