line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Maypole::HTTPD::Frontend; |
2
|
1
|
|
|
1
|
|
2329
|
use base 'CGI::Maypole'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
809
|
|
3
|
|
|
|
|
|
|
our $ct; |
4
|
|
|
|
|
|
|
our $output; |
5
|
|
|
|
|
|
|
our $cgi; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub get_request { shift->{cgi} = new CGI; } |
8
|
|
|
|
|
|
|
sub send_output { |
9
|
|
|
|
|
|
|
my $r = shift; |
10
|
|
|
|
|
|
|
my %headers = ( |
11
|
|
|
|
|
|
|
-type => $r->{content_type}, |
12
|
|
|
|
|
|
|
-charset => $r->{document_encoding}, |
13
|
|
|
|
|
|
|
-content_length => do { use bytes; length $r->{output} }, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
foreach ($r->headers_out->field_names) { |
16
|
|
|
|
|
|
|
next if /^Content-(Type|Length)/; |
17
|
|
|
|
|
|
|
$headers{"-$_"} = $r->headers_out->get($_); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$output=$r->{cgi}->header(%headers) . $r->{output}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub output_now { |
24
|
|
|
|
|
|
|
print $output; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Maypole::HTTP::Frontend - Maypole driver class for Maypole::HTTPD |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
This is a simple CGI based maypole driver for L. It's used |
36
|
|
|
|
|
|
|
automatically by the Maypole::HTTPD 'steal' function. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
It overrides the following functions in L: |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=over 4 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item get_request |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=item send_output |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=back |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 output_now |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Actually output what's been buffered by send_output. Used by L |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 SEE ALSO |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
L,L |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |