X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_ping.c;h=95d747953e3a37d8ede7a9abfac110e0127099f6;hb=refs%2Fheads%2Fupstream;hp=0d6c689502740c0b6c75080023263b0fe7816506;hpb=019cfd84e2b1138bef5d6d8fdec0347be223fca7;p=ircu2.10.12-pk.git diff --git a/ircd/m_ping.c b/ircd/m_ping.c index 0d6c689..95d7479 100644 --- a/ircd/m_ping.c +++ b/ircd/m_ping.c @@ -134,16 +134,19 @@ #include "client.h" #include "hash.h" +#include "ircd_log.h" #include "ircd_reply.h" #include "ircd_string.h" #include "ircd.h" #include "msg.h" #include "numeric.h" #include "numnicks.h" +#include "opercmds.h" #include "s_debug.h" #include "send.h" -#include +/* #include -- Now using assert in ircd_log.h */ +#include #include /* @@ -161,7 +164,7 @@ int m_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) if (parc < 2 || EmptyString(parv[1])) return send_reply(sptr, ERR_NOORIGIN); - sendcmdto_one(&me, CMD_PONG, sptr, "%C :%s", &me, origin); + sendcmdto_one(&me, CMD_PONG, sptr, "%C :%s", &me, parv[1]); return 0; } @@ -175,7 +178,7 @@ int m_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) int mo_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { struct Client* acptr; - char* destination; + char *destination; assert(0 != cptr); assert(cptr == sptr); @@ -219,7 +222,7 @@ int mo_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) */ /* - * ms_ping - server message handler template + * ms_ping - server message handler */ int ms_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { @@ -240,6 +243,14 @@ int ms_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) origin = parv[1]; destination = parv[2]; /* Will get NULL or pointer (parc >= 2!!) */ + if (parc > 3) + { + /* AsLL ping, send reply back */ + int diff = atoi(militime_float(parv[3])); + sendcmdto_one(&me, CMD_PONG, sptr, "%C %s %s %i %s", &me, origin, + parv[3], diff, militime_float(NULL)); + return 0; + } if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) { if ((acptr = FindServer(destination))) { /*