X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FAsyncMsg.pm;h=f8cd2f9f3b60bea14be79d24029a69049b685a9c;hb=d41556c82d7af6d68d9d659bd486be775f82295d;hp=ff3b3bca07c01eae0c52afbc43a6cebfe08830c8;hpb=511d83a615a5e65e85d7337c85280c2b6470a91b;p=spider.git diff --git a/perl/AsyncMsg.pm b/perl/AsyncMsg.pm index ff3b3bca..f8cd2f9f 100644 --- a/perl/AsyncMsg.pm +++ b/perl/AsyncMsg.pm @@ -269,6 +269,7 @@ sub disconnect if ($dxchan) { no strict 'refs'; $ondisc->($conn, $dxchan); + delete $conn->{on_disconnect}; } } delete $conn->{mojo}; @@ -276,6 +277,19 @@ sub disconnect $conn->SUPER::disconnect; } +sub _send_later +{ + my $conn = shift; + my $m = shift; + + if (isdbg('async')) { + my $s = $m; + $s =~ s/([\%\x00-\x1f\x7f-\xff])/sprintf("%%%02X", ord($1))/eg; + dbg("AsyncMsg: send $s"); + } + $conn->send_later($m); +} + sub DESTROY { my $conn = shift;