Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 8cd6ca9c authored by Rob Swindell's avatar Rob Swindell 💬

Wait for the correct PING reponse using a random token.

One potential issue here is if you connect/send to irc.synchro.net,
you'l going to get the PONG response back from a different hostname
(e.g. vert.synchro.net), which won't match the expected PONG response.
parent 7b4fd42c
......@@ -107,8 +107,14 @@ else while((msg=readln())!=undefined) { /* read from stdin */
while(my_server.poll(0) && (response=my_server.recvline()))
mylog(response);
if(my_server.sendline("PING :"+ nick)) {
mylog(my_server.recvline());
var token = format("%x", random(0x7fffffff));
if(my_server.sendline("PING :"+ token)) {
while(my_server.poll(5)) {
var response = my_server.recvline();
mylog(response);
if(response == (":" + server + " PONG " + server + " :" + token))
break;
}
}
IRC_quit(my_server);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment