]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/ping.cpp
Strip colons from server SSL fingerprint, to allow the output of certificate informat...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / ping.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
6  * See: http://wiki.inspircd.org/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #include "inspircd.h"
15 #include "socket.h"
16 #include "xline.h"
17 #include "socketengine.h"
18
19 #include "main.h"
20 #include "utils.h"
21 #include "treeserver.h"
22 #include "treesocket.h"
23
24 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
25
26 bool TreeSocket::LocalPing(const std::string &prefix, parameterlist &params)
27 {
28         if (params.size() < 1)
29                 return true;
30         if (params.size() == 1)
31         {
32                 std::string stufftobounce = params[0];
33                 this->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" PONG "+stufftobounce);
34                 return true;
35         }
36         else
37         {
38                 std::string forwardto = params[1];
39                 if (forwardto == ServerInstance->Config->ServerName || forwardto == ServerInstance->Config->GetSID())
40                 {
41                         // this is a ping for us, send back PONG to the requesting server
42                         params[1] = params[0];
43                         params[0] = forwardto;
44                         Utils->DoOneToOne(forwardto,"PONG",params,params[1]);
45                 }
46                 else
47                 {
48                         // not for us, pass it on :)
49                         Utils->DoOneToOne(prefix,"PING",params,forwardto);
50                 }
51                 return true;
52         }
53 }
54
55