line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MIME::Expander::Plugin::ApplicationGzip; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
78880
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
136
|
|
4
|
4
|
|
|
4
|
|
16
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
124
|
|
5
|
4
|
|
|
4
|
|
16
|
use vars qw($VERSION); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
232
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
50
|
use parent qw(MIME::Expander::Plugin); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
25
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw( |
10
|
|
|
|
|
|
|
application/gzip |
11
|
|
|
|
|
|
|
)]); |
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
4
|
|
1914
|
use IO::Uncompress::Gunzip; |
|
4
|
|
|
|
|
67937
|
|
|
4
|
|
|
|
|
611
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub expand { |
16
|
7
|
|
|
7
|
0
|
4453
|
my $self = shift; |
17
|
7
|
|
|
|
|
43
|
my $part = shift; |
18
|
7
|
|
|
|
|
19
|
my $callback = shift; |
19
|
7
|
|
|
|
|
12
|
my $c = 0; |
20
|
|
|
|
|
|
|
|
21
|
7
|
|
|
|
|
33
|
my $contents = $part->body; |
22
|
7
|
50
|
|
|
|
616
|
my $z = IO::Uncompress::Gunzip->new( |
23
|
|
|
|
|
|
|
\$contents, Append => 1 |
24
|
|
|
|
|
|
|
) or die "gunzip failed: $IO::Uncompress::Gunzip::GunzipError"; |
25
|
|
|
|
|
|
|
|
26
|
7
|
|
|
|
|
11441
|
my $buf; |
27
|
7
|
|
|
|
|
30
|
1 while( 0 < $z->read($buf) ); |
28
|
|
|
|
|
|
|
|
29
|
7
|
|
50
|
|
|
2277
|
my $h = $z->getHeaderInfo || {}; |
30
|
7
|
50
|
|
|
|
99
|
$callback->( \$buf, { |
31
|
|
|
|
|
|
|
filename => $h->{Name}, |
32
|
|
|
|
|
|
|
} ) if( ref $callback eq 'CODE' ); |
33
|
7
|
|
|
|
|
6367
|
++$c; |
34
|
|
|
|
|
|
|
|
35
|
7
|
|
|
|
|
76
|
return $c; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
__END__ |