projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added echo and noecho for clients to set/unset
[spider.git]
/
perl
/
Msg.pm
diff --git
a/perl/Msg.pm
b/perl/Msg.pm
index d067f27e31c35ee2fec876577a345eb2fb7a274b..b3816df3f324ade51480e1f65d4105cc13d13b6b 100644
(file)
--- a/
perl/Msg.pm
+++ b/
perl/Msg.pm
@@
-89,7
+89,7
@@
sub _enqueue {
my ($conn, $msg) = @_;
# prepend length (encoded as network long)
my $len = length($msg);
my ($conn, $msg) = @_;
# prepend length (encoded as network long)
my $len = length($msg);
- $msg =~ s/(
\x00-\x2f\x7e-\xff%
])/sprintf("%%%02X", ord($1))/eg;
+ $msg =~ s/(
[\%\x00-\x1f\x7f-\xff
])/sprintf("%%%02X", ord($1))/eg;
push (@{$conn->{queue}}, $msg . "\n");
}
push (@{$conn->{queue}}, $msg . "\n");
}
@@
-128,6
+128,7
@@
sub _send {
} else { # Uh, oh
delete $conn->{send_offset};
$conn->handle_send_err($!);
} else { # Uh, oh
delete $conn->{send_offset};
$conn->handle_send_err($!);
+ $conn->disconnect;
return 0; # fail. Message remains in queue ..
}
}
return 0; # fail. Message remains in queue ..
}
}
@@
-231,9
+232,10
@@
sub _rcv { # Complement to _send
}
FINISH:
}
FINISH:
- if (defined $bytes_read == 0) {
-
$conn->disconnect();
+ if (defined $bytes_read
&& $bytes_read
== 0) {
+
#
$conn->disconnect();
&{$conn->{rcvd_notification_proc}}($conn, undef, $!);
&{$conn->{rcvd_notification_proc}}($conn, undef, $!);
+ @lines = ();
}
while (@lines){
}
while (@lines){