-
Notifications
You must be signed in to change notification settings - Fork 64
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
Don't rely on RPL_YOURHOST parsing for connectivity checking #239
Comments
@osa1 I found this on https://www.irc.com/dev/docs/refs/numerics/002.html
Maybe to just rewrite parse_servername to use the prefix? |
Good idea @trevarj . Would be good to compare values parsed currently vs. the prefix, and whether using prefix would work for pinging. I just tried irc.gitter.im and |
Another idea is to use the prefix as a fallback, when current parser fails. |
This appears to work for all my servers, including gitter
|
@trevarj sounds good. Some suggestions:
|
Closes #239 Co-authored-by: Ömer Sinan Ağacan <omeragacan@gmail.com>
If anyone's following, the reason why this issue doesn't cause disconnects in irc.gitter.im is because the server sends a PING every 30 seconds:
So even if we never send a PING to irc.gitter.im we can maintain a connection. |
I discovered this while reviewing #237 (see my comment). We currently use the server name when sending PINGs to a server to check connectivity, but we can't do that if we don't know the server name, which we currently parse from the RPL_YOURHOST message. When parsing fails
servername
staysNone
, andsend_ping
just returns:tiny/libtiny_client/src/state.rs
Lines 29 to 31 in efcb303
This breaks connectivity checks when we can't parse RPL_YOURHOST for some reason. One example of this happening is when connecting to irc.gitter.im. Gitter's IRC server is not following the standards too closely and caused problems before (#214, #211). Currently RPL_YOURHOST from Gitter looks like this:
This is quite different than how RFC 2812 defines it:
What to do when we can't parse RPL_YOURHOST? I see a few options:
helix.oftc.net: osa1 PING Not enough parameters
Note that (1) and (2) works on irc.gitter.im, which doesn't seem care about the PING argument at all and always responds with a PONG immediately. (3) doesn't work as it doesn't seem to support HELP message.
cc @trevarj
The text was updated successfully, but these errors were encountered: