[Toolserver-l] Two beginner questions

River Tarnell river.tarnell at wikimedia.de
Fri Dec 10 10:41:49 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Михајло Анђелковић:
> I was returning the server whatever it was sending to me as a ping. This is 
> how it worked like two years ago. Has something changed?

This is the correct way to do it, but many IRC client implementations are lazy 
and are written by people who guess the protocol, and end up with an incomplete 
understanding, or simple don't care enough to implement it correctly since the 
incorrect solution works in most cases.

(As someone else pointed out, many IRC servers (especially hybrid-derived ones) 
use a "ping cookie" on connect; it was originally intended to defeat source 
address spoofing, but more recently has been used against other attacks.  If 
you don't reply correctly to a ping from one of these servers, you won't be 
able to connect.)

	- river.

PS: I cringe every time I see someone "parsing" IRC lines with things like 
strncmp(line, "PRIVMSG ", 8) or strstr(line, " :").  The IRC protocol is very 
simple, and tokenising it properly is really not that difficult.  (Every 
argument is separated by a space; if the first byte of the argument is ":", 
remove it and stop splitting.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAk0CA+0ACgkQIXd7fCuc5vIveQCfcbOkmQmGRxNCEZRLWuzLg51B
1w0Anil3POujv+MvallFnjAesOGYsoEL
=mL0N
-----END PGP SIGNATURE-----



More information about the Toolserver-l mailing list