projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix error message on disconnect from peer
[spider.git]
/
perl
/
Msg.pm
diff --git
a/perl/Msg.pm
b/perl/Msg.pm
index 60906c5964df83b0e547cd28628caaafefdf149c..3fa0e6762166816f86d31ebaaf2d2849b45a5ef9 100644
(file)
--- a/
perl/Msg.pm
+++ b/
perl/Msg.pm
@@
-234,9
+234,14
@@
sub disconnect
}
}
}
}
- if (
defined($sock)
) {
+ if (
ref $sock && $sock->isa('AnyEvent::Handle') && exists $sock->{fh}
) {
shutdown($sock->{fh}, 2);
$sock->destroy;
shutdown($sock->{fh}, 2);
$sock->destroy;
+ } else {
+ my $s;
+ $s = "already destroyed" unless exists $sock->{fh};
+ $s ||= ref $sock || $sock || "undefined";
+ dbg("Msg::disconnect trying to disconnect a $s socket") if isdbg('chan');
}
unless ($main::is_win) {
}
unless ($main::is_win) {