line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hoppy::TestFilter; |
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
3
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
4
|
1
|
|
|
1
|
|
6
|
use base qw(POE::Filter::Line); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
530
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my $c; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub FRAMING_BUFFER () { 0 } |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
1
|
|
|
1
|
1
|
17
|
my $class = shift; |
12
|
1
|
|
|
|
|
2
|
$c = shift; |
13
|
1
|
|
|
|
|
15
|
my $self = |
14
|
|
|
|
|
|
|
$class->SUPER::new( InputRegexp => qr/\x00|\n/, OutputLiteral => "\x00" ); |
15
|
1
|
|
|
|
|
64
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub get_one_start { |
19
|
1
|
|
|
1
|
1
|
1845
|
my $self = shift; |
20
|
1
|
|
|
|
|
14
|
$self->SUPER::get_one_start(@_); |
21
|
1
|
50
|
|
|
|
44
|
if ( $self->[FRAMING_BUFFER] =~ /\n$/s ) { |
22
|
1
|
|
|
|
|
11
|
my $session_id = POE::Kernel->get_active_session->ID; |
23
|
1
|
|
|
|
|
12
|
$c->{test_client}->{$session_id} = 1; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub put { |
28
|
1
|
|
|
1
|
1
|
9
|
my $self = shift; |
29
|
1
|
|
|
|
|
5
|
my $session_id = POE::Kernel->get_active_session->ID; |
30
|
1
|
50
|
|
|
|
8
|
if ( $c->{test_client}->{$session_id} ) { |
31
|
1
|
|
|
|
|
2
|
my $lines = shift; |
32
|
1
|
|
|
|
|
2
|
my @raw; |
33
|
1
|
|
|
|
|
4
|
foreach (@$lines) { |
34
|
1
|
|
|
|
|
4
|
push @raw, $_ . "\n"; |
35
|
|
|
|
|
|
|
} |
36
|
1
|
|
|
|
|
8
|
return \@raw; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
else { |
39
|
0
|
|
|
|
|
|
$self->SUPER::put(@_); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
__END__ |