X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_ping.c;h=435b7c68d1006b89ef0f1674c9390946832b6f82;hb=5ba09703da9f8f21f3278dc0222cd6fe077cfe31;hp=82c493b9e968ce49b0564b131d76eefcd856103f;hpb=e9d69ffa05639cedd682684fc7c518dcfbc64bfe;p=ircu2.10.12-pk.git diff --git a/ircd/m_ping.c b/ircd/m_ping.c index 82c493b..435b7c6 100644 --- a/ircd/m_ping.c +++ b/ircd/m_ping.c @@ -140,10 +140,12 @@ #include "msg.h" #include "numeric.h" #include "numnicks.h" +#include "opercmds.h" #include "s_debug.h" #include "send.h" #include +#include #include /* @@ -175,15 +177,24 @@ 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, *origin; assert(0 != cptr); assert(cptr == sptr); if (parc < 2 || EmptyString(parv[1])) return send_reply(sptr, ERR_NOORIGIN); + 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))) sendcmdto_one(sptr, CMD_PING, acptr, "%C :%s", sptr, destination);