Subject: | Neverending loop on socket failure |
Today, my services was stuck in a loop of failed socket sending. Stuck on row 347 of IRCService.pm, complainng about undef value. I'm not sure this will help, but it should exit that particular loop in case of failure:
while (length($data)) {
foreach $socket ($select->can_write(0)) {
while (length($data)>0) {
$rv = $socket->send($data, 0) or last;
substr($data,0,$rv)='';
}
}
}
I added the "or last".