Skip to content
Snippets Groups Projects
Commit e3da86c6 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

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 85bd0c84
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment