]> jfr.im git - irc/unrealircd/unrealircd-rpc-php.git/commitdiff
Workaround library bug in eventloop(). Apparently if there is little
authorBram Matthys <redacted>
Mon, 10 Apr 2023 15:56:19 +0000 (17:56 +0200)
committerBram Matthys <redacted>
Mon, 10 Apr 2023 15:56:19 +0000 (17:56 +0200)
activity and we catch the timeout once and we continue, then if there
is some other error like server killed or otherwise connection lost
then it will refire as a timeout, and this happens endlessly, so
resulting in 100% CPU loop.
We now detect it by (far) too little execution time, ah well, it is
a workaround that works :D.

So this should be safe now (was introduced a previous commit,
still the same code):

$rpc->log()->subscribe(Array("!debug","all"));
while(1)
{
    echo "Waiting...\n";
    $res = $rpc->eventloop();
    var_export($res);
    echo "\n";
}


No differences found