Rewrote the socket engine. This should fix random timeouts.
This commit is contained in:
1 parent
ccad64635e
commit
f7481bc0fa
2 files changed
+19
-8
No files matched your search
@@ -324,20 +324,30 @@ while (1) {
|
|||||||
$sockid = $_ if ($SOCKET{$_} eq $sock);
|
$sockid = $_ if ($SOCKET{$_} eq $sock);
|
||||||
}
|
}
|
||||||
# Read the data.
|
# Read the data.
|
||||||
my $data = readline($sock);
|
my $idata;
|
||||||
if (!defined $data) {
|
recv($sock, $idata, POSIX::BUFSIZ, 0);
|
||||||
|
|
||||||
|
# Check for the data.
|
||||||
|
if (!defined $idata || length($idata) == 0) {
|
||||||
# Got EOF, close socket
|
# Got EOF, close socket
|
||||||
err(2, "Lost connection to $sockid!", 0);
|
err(2, "Lost connection to $sockid!", 0);
|
||||||
$SELECT->remove($sock);
|
$SELECT->remove($sock);
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
# Remove the newlines.
|
|
||||||
chomp $data;
|
|
||||||
# Debug.
|
|
||||||
dbug $sockid." >> ".$data;
|
|
||||||
|
|
||||||
# Parse data.
|
# Read the buffer.
|
||||||
Parser::IRC::ircparse($sockid, $data);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
==================================================================
|
==================================================================
|
||||||
|
* Rewrote the socket engine. This should fix random timeouts.
|
||||||
* Added IsItUp module.
|
* Added IsItUp module.
|
||||||
* Added user:net for network-specific user blocks.
|
* Added user:net for network-specific user blocks.
|
||||||
* Bug fix: Fixed broken no-parameter config blocks.
|
* Bug fix: Fixed broken no-parameter config blocks.
|
||||||
|
|||||||
Reference in new issue
Block a user