Rewrote the socket engine. This should fix random timeouts.

This commit is contained in:
Elijah Perrault committed 2011-02-02 20:49:19 -07:00
1 parent ccad64635e
commit f7481bc0fa
2 files changed
+19 -8

No files matched your search

+18 -8
View File
@@ -324,20 +324,30 @@ while (1) {
$sockid = $_ if ($SOCKET{$_} eq $sock);
}
# Read the data.
my $data = readline($sock);
if (!defined $data) {
my $idata;
recv($sock, $idata, POSIX::BUFSIZ, 0);
# Check for the data.
if (!defined $idata || length($idata) == 0) {
# Got EOF, close socket
err(2, "Lost connection to $sockid!", 0);
$SELECT->remove($sock);
next;
}
# Remove the newlines.
chomp $data;
# Debug.
dbug $sockid." >> ".$data;
# Parse data.
Parser::IRC::ircparse($sockid, $data);
# Read the buffer.
my $data .= $idata;
while ($data =~ s/(.*\n)//) {
my $line = $1;
# Remove the newlines.
chomp $line;
# Debug.
dbug $sockid." >> ".$line;
# Parse data.
Parser::IRC::ircparse($sockid, $line);
}
}
}
+1
View File
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev
==================================================================
* Rewrote the socket engine. This should fix random timeouts.
* Added IsItUp module.
* Added user:net for network-specific user blocks.
* Bug fix: Fixed broken no-parameter config blocks.