- Debug((DEBUG_DEBUG, "end_ping: %p", pptr));
- delete_resolver_queries((void*) pptr);
- if (pptr->client)
- {
- if (MyUser(pptr->client)
- || (IsServer(pptr->client->from) && Protocol(pptr->client->from) < 10))
- {
- if (pptr->lastsent) /* Started at all ? */
- {
- if (0 < pptr->received) /* Received any pings at all? */
- {
- sendto_one(pptr->client, ":%s NOTICE %s :UPING %s%s",
- me.name, pptr->client->name, pptr->name, pptr->buf);
- /* XXX - warning long unsigned int format, unsigned int arg (7, 8, 9) */
- sendto_one(pptr->client,
- ":%s NOTICE %s :UPING Stats: sent %d recvd %d ; "
- "min/avg/max = %1lu/%1lu/%1lu ms",
- me.name, pptr->client->name, pptr->sent,
- pptr->received, pptr->ms_min,
- (2 * pptr->ms_ave) / (2 * pptr->received),
- pptr->ms_max);
- }
- else
- sendto_one(pptr->client,
- ":%s NOTICE %s :UPING: no response from %s within %d seconds",
- me.name, pptr->client->name, pptr->name,
- UPINGTIMEOUT);
- }
- else
- sendto_one(pptr->client,
- ":%s NOTICE %s :UPING: Could not start ping to %s %d",
- me.name, pptr->client->name, pptr->name, ntohs(pptr->sin.sin_port));
- }
- else
- {
- if (pptr->lastsent) /* Started at all ? */
- {
- if (0 < pptr->received) /* Received any pings at all? */
- {
- sendto_one(pptr->client, "%s NOTICE %s%s :UPING %s%s",
- NumServ(&me), NumNick(pptr->client), pptr->name, pptr->buf);
- /* XXX - warning: long unsigned int format, unsigned int arg(9, 10, 11) */
- sendto_one(pptr->client,
- "%s NOTICE %s%s :UPING Stats: sent %d recvd %d ; "
- "min/avg/max = %1lu/%1lu/%1lu ms",
- NumServ(&me), NumNick(pptr->client), pptr->sent,
- pptr->received, pptr->ms_min,
- (2 * pptr->ms_ave) / (2 * pptr->received),
- pptr->ms_max);
- }
- else
- sendto_one(pptr->client,
- "%s NOTICE %s%s :UPING: no response from %s within %d seconds",
- NumServ(&me), NumNick(pptr->client), pptr->name,
- UPINGTIMEOUT);
- }
- else
- sendto_one(pptr->client,
- "%s NOTICE %s%s :UPING: Could not start ping to %s %d",
- NumServ(&me), NumNick(pptr->client), pptr->name,
- ntohs(pptr->sin.sin_port));
- }
+ Debug((DEBUG_DEBUG, "uping_end: %p", pptr));
+
+ if (pptr->client) {
+ if (pptr->lastsent) {
+ if (0 < pptr->received) {
+ sendcmdto_one(&me, CMD_NOTICE, pptr->client, "%C :UPING %s%s",
+ pptr->client, pptr->name, pptr->buf);
+ sendcmdto_one(&me, CMD_NOTICE, pptr->client, "%C :UPING Stats: "
+ "sent %d recvd %d ; min/avg/max = %u/%u/%u ms",
+ pptr->client, pptr->sent, pptr->received, pptr->ms_min,
+ (2 * pptr->ms_ave) / (2 * pptr->received), pptr->ms_max);
+ } else
+ sendcmdto_one(&me, CMD_NOTICE, pptr->client, "%C :UPING: no response "
+ "from %s within %d seconds", pptr->client, pptr->name,
+ UPINGTIMEOUT);
+ } else
+ sendcmdto_one(&me, CMD_NOTICE, pptr->client, "%C :UPING: Could not "
+ "start ping to %s", pptr->client, pptr->name);