line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Eve::HttpOutput; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
39
|
use parent qw(Eve::Class); |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
43
|
|
4
|
|
|
|
|
|
|
|
5
|
8
|
|
|
8
|
|
384
|
use strict; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
210
|
|
6
|
8
|
|
|
8
|
|
35
|
use warnings; |
|
8
|
|
|
|
|
11
|
|
|
8
|
|
|
|
|
1306
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
B - an event handler for HTTP response events. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use Eve::HttpOuput; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $output = Eve::HttpOutput->new(filehandle => STDOUT); |
17
|
|
|
|
|
|
|
$dispatcher->handle(event => $event); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
B class is an output controller for HTTP |
22
|
|
|
|
|
|
|
applications. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head3 Constructor arguments |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=over 3 |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=item C |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
a filehandle to write the output data to. Usualy it is STDOUT, |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=back |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 METHODS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 B |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub init { |
41
|
0
|
|
|
0
|
1
|
|
my ($self, %arg_hash) = @_; |
42
|
0
|
|
|
|
|
|
Eve::Support::arguments( |
43
|
|
|
|
|
|
|
\%arg_hash, my $filehandle); |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
$self->{'_filehandle'} = $filehandle; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
return; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 B |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Handles an event containing an HTTP response instance performing the |
53
|
|
|
|
|
|
|
output. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head3 Arguments |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=over 4 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item C |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
an event containing the HTTP response object. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=back |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub handle { |
68
|
0
|
|
|
0
|
1
|
|
my ($self, %arg_hash) = @_; |
69
|
0
|
|
|
|
|
|
Eve::Support::arguments(\%arg_hash, my $event); |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
print {$self->_filehandle} $event->response->get_text(); |
|
0
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
|
return; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 SEE ALSO |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=over 4 |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item L |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item L |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=back |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Copyright 2012 Igor Zinovyev. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
91
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
92
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 AUTHOR |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=over 4 |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item L |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=back |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
1; |