line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hoppy::TCPHandler::Input; |
2
|
7
|
|
|
7
|
|
41
|
use strict; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
240
|
|
3
|
7
|
|
|
7
|
|
39
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
196
|
|
4
|
7
|
|
|
7
|
|
41
|
use base qw( Hoppy::Base ); |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
14247
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub do_handle { |
7
|
1
|
|
|
1
|
1
|
13
|
my $self = shift; |
8
|
1
|
|
|
|
|
3
|
my $poe = shift; |
9
|
1
|
|
|
|
|
13
|
my $c = $self->context; |
10
|
1
|
|
|
|
|
28
|
my $input = $poe->args->[0]; |
11
|
|
|
|
|
|
|
|
12
|
1
|
50
|
|
|
|
16
|
if ( $input =~ /policy-file-request/ ) { |
|
|
50
|
|
|
|
|
|
13
|
0
|
|
|
|
|
0
|
my $xml = $self->cross_domain_policy_xml; |
14
|
0
|
|
|
|
|
0
|
$c->handler->{Send}->do_handle( $poe, $xml ); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
elsif ( $input =~ /^exit(\x00)*/ ) { |
17
|
0
|
|
|
|
|
0
|
$c->handler->{Disconnected}->do_handle($poe); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
else { |
20
|
1
|
|
|
|
|
3
|
my $in_data = ''; |
21
|
1
|
|
|
|
|
9
|
eval { $in_data = $c->formatter->deserialize($input); }; |
|
1
|
|
|
|
|
7
|
|
22
|
1
|
50
|
|
|
|
3
|
if ($@) { |
23
|
0
|
|
|
|
|
0
|
warn "IO Format Error: $@"; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
else { |
26
|
1
|
|
|
|
|
6
|
$c->dispatch( $in_data, $poe ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
1
|
50
|
|
|
|
14
|
if ( my $hook = $c->hook->{client_input} ) { |
31
|
0
|
|
|
|
|
|
$hook->work( { poe => $poe } ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub cross_domain_policy_xml { |
36
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
37
|
0
|
|
|
|
|
|
my $xml = <<" END"; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
END |
44
|
0
|
|
|
|
|
|
return $xml; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |