projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added cgi_weather
[spider.git]
/
perl
/
IntMsg.pm
diff --git
a/perl/IntMsg.pm
b/perl/IntMsg.pm
index 8065f3024e5c693e04e7b50620a5d136e83c2a00..a940347d311366227a069b07e1d03ad9b79f0f28 100644
(file)
--- a/
perl/IntMsg.pm
+++ b/
perl/IntMsg.pm
@@
-10,6
+10,13
@@
package IntMsg;
use strict;
package IntMsg;
use strict;
+
+use vars qw($VERSION $BRANCH);
+$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
+$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
+$main::build += $VERSION;
+$main::branch += $BRANCH;
+
use Msg;
use vars qw(@ISA);
use Msg;
use vars qw(@ISA);
@@
-27,21
+34,20
@@
sub dequeue
{
my $conn = shift;
{
my $conn = shift;
- if ($conn
->{msg} =~ /\n
/) {
- my @lines =
split /\r?\n/, $conn->{msg}
;
- if ($conn->{msg} =~ /\
n
$/) {
+ if ($conn
&& $conn->{msg} =~ /\cJ
/) {
+ my @lines =
$conn->{msg} =~ /([^\cM\cJ]*)\cM?\cJ/g
;
+ if ($conn->{msg} =~ /\
cJ
$/) {
delete $conn->{msg};
} else {
delete $conn->{msg};
} else {
- $conn->{msg} =
pop @lines
;
+ $conn->{msg} =
~ s/([^\cM\cJ]*)\cM?\cJ//g
;
}
for (@lines) {
if (defined $_) {
s/\%([0-9A-F][0-9A-F])/chr(hex($1))/eg;
}
for (@lines) {
if (defined $_) {
s/\%([0-9A-F][0-9A-F])/chr(hex($1))/eg;
- s/[\x00-\x08\x0a-\x1f\x80-\x9f]/./g; # immutable CSI sequence + control characters
} else {
$_ = '';
}
} else {
$_ = '';
}
- &{$conn->{rproc}}($conn, $_);
+ &{$conn->{rproc}}($conn, $_)
if exists $conn->{rproc}
;
}
}
}
}
}
}