This should fix a socket timeout issue.
This commit is contained in:
1 parent
3b95067bf6
commit
df2b9fa16e
2 files changed
+13
-2
No files matched your search
@@ -100,7 +100,8 @@ println <<'EOF';
|
|||||||
EOF
|
EOF
|
||||||
println "* ".NAME." (version ".VER.".".SVER.".".REV.RSTAGE.") is starting up...";
|
println "* ".NAME." (version ".VER.".".SVER.".".REV.RSTAGE.") is starting up...";
|
||||||
|
|
||||||
our ($APID, %TIMERS);
|
our ($APID, %TIMERS, $SOCKTIMEOUT);
|
||||||
|
$SOCKTIMEOUT = 0;
|
||||||
|
|
||||||
# Check for debug mode.
|
# Check for debug mode.
|
||||||
our $DEBUG = 0;
|
our $DEBUG = 0;
|
||||||
@@ -272,6 +273,8 @@ foreach my $cskey (keys %cservers) {
|
|||||||
API::IRC::nick($cskey, $cservers{$cskey}{'nick'}[0]);
|
API::IRC::nick($cskey, $cservers{$cskey}{'nick'}[0]);
|
||||||
# Add to select.
|
# Add to select.
|
||||||
$SELECT->add($SOCKET{$cskey});
|
$SELECT->add($SOCKET{$cskey});
|
||||||
|
# Set some other variables.
|
||||||
|
$Parser::IRC::got_001{$cskey} = 0;
|
||||||
# Success!
|
# Success!
|
||||||
alog "** Successfully connected to server: ".$cskey;
|
alog "** Successfully connected to server: ".$cskey;
|
||||||
dbug "** Successfully connected to server: ".$cskey;
|
dbug "** Successfully connected to server: ".$cskey;
|
||||||
@@ -316,7 +319,7 @@ while (1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Socket check.
|
# Socket check.
|
||||||
foreach my $sock ($SELECT->can_read(1)) {
|
foreach my $sock ($SELECT->can_read($SOCKTIMEOUT)) {
|
||||||
# Figure out what network is sending us data.
|
# Figure out what network is sending us data.
|
||||||
my $sockid;
|
my $sockid;
|
||||||
foreach (keys %SOCKET) {
|
foreach (keys %SOCKET) {
|
||||||
|
|||||||
@@ -85,6 +85,14 @@ sub num001
|
|||||||
my ($svr, @ex) = @_;
|
my ($svr, @ex) = @_;
|
||||||
|
|
||||||
$got_001{$svr} = 1;
|
$got_001{$svr} = 1;
|
||||||
|
my $stst = 1;
|
||||||
|
foreach (keys %got_001) {
|
||||||
|
if (!$got_001{$_}) {
|
||||||
|
$stst = 0;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$Auto::SOCKTIMEOUT = 1 if $stst;
|
||||||
|
|
||||||
# In case we don't get NICK from the server.
|
# In case we don't get NICK from the server.
|
||||||
if (defined $botnick{$svr}{newnick}) {
|
if (defined $botnick{$svr}{newnick}) {
|
||||||
|
|||||||
Reference in new issue
Block a user