add a no-activity timeout preventing bot from getting "stuck"
commit21a80ce66327b21c14281e4120502a5b7f2e090d
authorrofl0r <retnyg@gmx.net>
Fri, 30 Mar 2018 16:38:08 +0000 (30 17:38 +0100)
committerrofl0r <retnyg@gmx.net>
Fri, 30 Mar 2018 16:38:08 +0000 (30 17:38 +0100)
tree6581c44608005402b0f4f565e76e10f2f6b9fcb4
parent952d722cdcc71d47c2637e042ce5e1846d2b5fa3
add a no-activity timeout preventing bot from getting "stuck"

for some reason, maybe due to a bug in wolfssl, which is used by rocksock's
ssl layer, it can happen that even though the bot got disconnected (happened
in a netsplit situation, running rocksock_peek on the socket, which calls
CyaSSL_pending() and select() on the socket, no error is reported, and the
main loop calling rsirc_process() never detects the exceptional situation.
for that reason we assume if we didn't receive anything from the IRC server
for 5 minutes, that the connection is dead (there should be regular PINGs
every 1-2 mins usually).
jsbot.c