projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clean up Msg debugging further
[spider.git]
/
perl
/
Msg.pm
diff --git
a/perl/Msg.pm
b/perl/Msg.pm
index e2092a90eeb941b06ce35a2c32f01382370a46ae..61974b962160173f02e671c7986fe1ab6dbf148c 100644
(file)
--- a/
perl/Msg.pm
+++ b/
perl/Msg.pm
@@
-253,17
+253,15
@@
sub disconnect
{
my $conn = shift;
my $count = $conn->{disconnecting}++;
{
my $conn = shift;
my $count = $conn->{disconnecting}++;
+ my $dbg = isdbg('connll');
+ my ($pkg, $fn, $line) = caller if $dbg;
+
if ($count > 2) {
if ($count > 2) {
- if (isdbg('connll')) {
- my ($pkg, $fn, $line) = caller;
- dbg((ref $conn) . "::disconnect on call $conn->{call} attempt $conn->{disconnecting} called from ${pkg}::${fn} line $line FORCING CLOSE ");
- }
+ dbg((ref $conn) . "::disconnect on call $conn->{call} attempt $conn->{disconnecting} called from ${pkg}::${fn} line $line FORCING CLOSE ") if $dbg;
_close_it($conn);
_close_it($conn);
+ return;
}
}
- if (isdbg('connll')) {
- my ($pkg, $fn, $line) = caller;
- dbg((ref $conn) . "::disconnect on call $conn->{call} attempt $conn->{disconnecting} called from ${pkg}::${fn} line $line ");
- }
+ dbg((ref $conn) . "::disconnect on call $conn->{call} attempt $conn->{disconnecting} called from ${pkg}::${fn} line $line ") if $dbg;
return if $count;
# remove this conn from the active queue
return if $count;
# remove this conn from the active queue
@@
-290,20
+288,21
@@
sub disconnect
# Mojo::IOLoop->delay (
sub {
my $delay = shift;
# Mojo::IOLoop->delay (
sub {
my $delay = shift;
- dbg("before drain $call");
+ dbg("before drain $call")
if $dbg
;
$sock->on(drain => $delay->begin);
1;
},
sub {
my $delay = shift;
$sock->on(drain => $delay->begin);
1;
},
sub {
my $delay = shift;
+ dbg("before _close_it $call") if $dbg;
_close_it($conn);
1;
}
);
$conn->{delay}->wait;
_close_it($conn);
1;
}
);
$conn->{delay}->wait;
-
+
} else {
} else {
- dbg((ref $conn) . " socket missing on $conn->{call}") if
isdbg('connll')
;
+ dbg((ref $conn) . " socket missing on $conn->{call}") if
$dbg
;
_close_it($conn);
}
}
_close_it($conn);
}
}