This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Undernet IRC Server Source Code.".
The branch, u2_10_12_branch has been updated
via 5fd43bce49d7e518a32eef1e93892f35f92f1225 (commit)
from 9c524c2739d97ea858b4bcbb45a7d057e4fbbc19 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5fd43bce49d7e518a32eef1e93892f35f92f1225
Author: Michael Poole <[email protected]>
Date: Thu Oct 20 23:38:06 2016 -0400
Make remote PING work like one would expect.
Fixes SF#171, although RPING and ASLL are better choices.
diff --git a/ircd/m_ping.c b/ircd/m_ping.c
index 95d7479..f1f9777 100644
--- a/ircd/m_ping.c
+++ b/ircd/m_ping.c
@@ -178,6 +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 *origin;
char *destination;
assert(0 != cptr);
assert(cptr == sptr);
@@ -185,28 +186,19 @@ int mo_ping(struct Client* cptr, struct Client* sptr, int
parc, char* parv[])
if (parc < 2 || EmptyString(parv[1]))
return send_reply(sptr, ERR_NOORIGIN);
+ /* Historically, the text here was truncated to 64 bytes. */
+ origin = parv[1];
+ if (strlen(origin) > 64)
+ origin[64] = '\0';
destination = parv[2]; /* Will get NULL or pointer (parc >= 2!!) */
if (!EmptyString(destination) && 0 != ircd_strcmp(destination,
cli_name(&me))) {
if ((acptr = FindServer(destination)))
- sendcmdto_one(sptr, CMD_PING, acptr, "%C :%s", sptr, destination);
+ sendcmdto_one(sptr, CMD_PING, acptr, "%s :%s", origin, destination);
else
send_reply(sptr, ERR_NOSUCHSERVER, destination);
}
else {
- /*
- * NOTE: clients rely on this to return the origin string.
- * it's pointless to send more than 64 bytes back tho'
- */
- char* origin = parv[1];
-
- /* Is this supposed to be here? */
- acptr = FindClient(origin);
- if (acptr && acptr != sptr)
- origin = cli_name(cptr);
-
- if (strlen(origin) > 64)
- origin[64] = '\0';
sendcmdto_one(&me, CMD_PONG, sptr, "%C :%s", &me, origin);
}
return 0;
@@ -271,7 +263,7 @@ int ms_ping(struct Client* cptr, struct Client* sptr, int
parc, char* parv[])
* NOTE: sptr is never local so if pong handles numerics everywhere we
* could send a numeric here.
*/
- sendcmdto_one(&me, CMD_PONG, sptr, "%C :%s", &me, origin);
+ sendcmdto_one(&me, CMD_PONG, sptr, "%s :%C", origin, sptr);
}
return 0;
}
diff --git a/ircd/m_pong.c b/ircd/m_pong.c
index df29b9f..d18deec 100644
--- a/ircd/m_pong.c
+++ b/ircd/m_pong.c
@@ -108,7 +108,6 @@
*/
int ms_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
- char* origin;
char* destination;
assert(0 != cptr);
assert(0 != sptr);
@@ -117,7 +116,6 @@ int ms_pong(struct Client* cptr, struct Client* sptr, int
parc, char* parv[])
if (parc < 2 || EmptyString(parv[1])) {
return protocol_violation(sptr,"No Origin on PONG");
}
- origin = parv[1];
destination = parv[2];
ClearPingSent(cptr);
ClearPingSent(sptr);
@@ -144,8 +142,12 @@ int ms_pong(struct Client* cptr, struct Client* sptr, int
parc, char* parv[])
else if (0 != ircd_strcmp(destination, cli_name(&me)))
{
struct Client* acptr;
- if ((acptr = FindClient(destination)))
- sendcmdto_one(sptr, CMD_PONG, acptr, "%s %s", origin, destination);
+ if ((acptr = findNUser(destination))) {
+ if (MyUser(acptr))
+ sendcmdto_one(sptr, CMD_PONG, acptr, "%C %s", sptr, parv[1]);
+ else
+ sendcmdto_one(sptr, CMD_PONG, acptr, "%s %C", parv[1], acptr);
+ }
}
return 0;
}
-----------------------------------------------------------------------
Summary of changes:
ircd/m_ping.c | 22 +++++++---------------
ircd/m_pong.c | 10 ++++++----
2 files changed, 13 insertions(+), 19 deletions(-)
hooks/post-receive
--
Undernet IRC Server Source Code.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches