-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep-Alive ping #6
Comments
this is what circe-lagmon-mode does, though it doesn't ignore the answer - it reports your lag. |
Hm. I think I want that as a general element in circe.el – Emacs doesn't do keepalive otherwise, and if you lose connection, Circe will just happily sit there doing nothing. Basically:
No CTCP needed, just PING/PONG with the server. I think I can implement that with quite a few lines of code. |
Is it legal/standard to send extra text in a PING? I don't see mention of this in the irc rfc (that is why lagmon uses CTCP). |
Heh. Re-checking the RFC 2812, no, that's not strictly speaking legal. But I know of no ircd implementation that implements PINGs like that. Guess more investigation needed. |
Ok, implementations differ slightly on the defailts, but all implementations tested send back the string passed. PING foo
|
according to the rfc: PING WiZ ; PING message being sent to nick WiZ what gives? |
IRC has a historic problem with constantly confusing the server/server and server/client protocol. A few early exploits were based on that (servers trusting clients more than they should). The PING description is still from the server/server protocol. Clients should actually never need to send a PING, only PONG. Implementation of PING from the Freenode ircd: /*
** m_ping
** parv[1] = origin
** parv[2] = destination
*/
static int
m_ping(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Client *target_p;
const char *destination;
destination = parv[2]; /* Will get NULL or pointer (parc >= 2!!) */
if(!EmptyString(destination) && !match(destination, me.name))
{
if((target_p = find_server(source_p, destination)))
{
sendto_one(target_p, ":%s PING %s :%s",
get_id(source_p, target_p),
source_p->name, get_id(target_p, target_p));
}
else
{
sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
form_str(ERR_NOSUCHSERVER),
destination);
return 0;
}
}
else
sendto_one(source_p, ":%s PONG %s :%s", me.name,
(destination) ? destination : me.name, parv[1]);
return 0;
} I.e. if there is only one argument, that's always just sent back. You can send a PING to another server using
I.e. the second PING was passed over to the other server. The message between hitchcock and cameron will have been The Freenode ircd implementation of PONG shows this confusion with server/server and server/client:
|
Forgot the important part: They took out client/client PING/PONG because that can be used for flooding. Get 5 clients to send PINGs to a single one, and he'll flood himself out. |
Okay, thanks for explaining that. Do you have any feeling on whether circe-lagmon should be changed to use PING instead of CTCP? The one point against that I can see is that it would need to install a PONG handler, and if another PONG handler was installed for some reason, the conflict would need to be resolved. |
I'm a bit iffy about absolutely relying on the argument of PING to be passed back. If it doesn't, for the keepalive thing, Circe might show some spurious PONG messages. For lagmon, the whole code would break. But thinking more about it, an own CTCP LAGMON isn't all that bad an idea, code-wise. Doesn't rely on spurious IRC protocol details that might change without warning, works reliably, no ambiguity. Hm. |
k, i agree with that |
This is sufficiently handled by circe-lagmon. No further action required. |
Not necessarily trying to revive a dead horse but CTCP requests have the side effect that they don't work as good when more than once client is used. The other clients might react on the CTCP request and send out notifications. |
Circe should send out periodical PING messages to the server to test for broken connections. The PONG answer should be ignored.
The text was updated successfully, but these errors were encountered: