lib/SOAP/Transport/HTTP.pm

filter: Statementstmt 66.6% 276 / 414 Branchbran 43.0% 93 / 216 Conditioncond 33.3% 57 / 171 MC/DCmcdc 4.6% 4 / 87 Subroutinesub 80.7% 46 / 57 Podpod n/a totaltotal 50.3% 476 / 945 CC 173 SCAR 42.8
CC
173
Cov
53%
send_receive
180.1
handle
127.1
handler
110.0
CRAP 72.5
« lib/SOAP/Test.pm ↑ Summary lib/SOAP/Transport/POP3.pm »
1 # ======================================================================
2 #
3 # Copyright (C) 2000-2004 Paul Kulchenko (paulclinger@yahoo.com)
4 # SOAP::Lite is free software; you can redistribute it
5 # and/or modify it under the same terms as Perl itself.
6 #
7 # ======================================================================
8  
9 package SOAP::Transport::HTTP;
10  
11 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 17 our $VERSION = 1.17;
14  
15 17 ▶use SOAP::Lite;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 17 ▶use SOAP::Packager;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 # ======================================================================
19  
20 package SOAP::Transport::HTTP::Client;
21  
22 17 ▶use vars qw(@ISA $COMPRESS $USERAGENT_CLASS);
Subroutine BEGIN: called CC=1 SCAR=0.0
23 17 $USERAGENT_CLASS = 'LWP::UserAgent';
24 17 @ISA = qw(SOAP::Client);
25  
26 17 $COMPRESS = 'deflate';
27  
28 17 my ( %redirect, %mpost, %nocompress );
29  
30 # hack for HTTP connection that returns Keep-Alive
31 # miscommunication (?) between LWP::Protocol and LWP::Protocol::http
32 # dies after timeout, but seems like we could make it work
33 17 my $_patched = 0;
34  
35 sub patch {
36 17 ▶ return if $_patched;
Subroutine patch: called CC=2 SCAR=9.2
Branch: 1 branch
BranchTrueFalseTotal
if $_patched 2 15 17
37 17 ▶ BEGIN { local ($^W) = 0; }
Subroutine BEGIN: called CC=1 SCAR=0.0
38 {
39 15 local $^W = 0;
40 sub LWP::UserAgent::redirect_ok;
41 1 ▶ *LWP::UserAgent::redirect_ok = sub { 1 }
Subroutine __ANON__: called CC=1 SCAR=0.0
42 15 }
43 {
44  
45 15 package
46 LWP::Protocol;
47 15 local $^W = 0;
48 15 my $collect = \&collect; # store original
49 *collect = sub {
50 2 ▶ if ( defined $_[2]->header('Connection')
Subroutine __ANON__: called CC=5 SCAR=29.0
Branch: 1 branch
BranchTrueFalseTotal
if (defined $_[2]->header("Connection") and $_[2]->header("Connection") eq "Keep-Alive") 0 2 2
Condition33%1/3
defined $_[2]->header("Connection") and $_[2]->header("Connection") eq "Keep-Alive"
!ll&&!rl&&r
020
MC/DC0%0/2
defined $_[2]->header("Connection") and $_[2]->header("Connection") eq "Keep-Alive"
defined $_[2]->header("Connection") $_[2]->header("Connection") eq "Keep-Alive"
Truth table33%1/3
A and B
A= defined $_[2]->header("Connection")B= $_[2]->header("Connection") eq "Keep-Alive"
ABresult
0X0
100
111
51 && $_[2]->header('Connection') eq 'Keep-Alive' ) {
52 0 my $data = $_[3]->();
53 my $next =
54 $_[2]->header('Content-Length') &&
55 SOAP::Utils::bytelength($$data) ==
56 $_[2]->header('Content-Length')
57 0 ▶ ? sub { my $str = ''; \$str; }
Subroutine __ANON__: not called CC=1 SCAR=6.9
58 0 ▶ : $_[3];
Branch: 1 branch
BranchTrueFalseTotal
$_[2]->header('Content-Length') && SOAP::Utils::bytelength($$data) == $_[2]->header('Content-Length') ? : 0 0 0
Condition0%0/3
$_[2]->header("Content-Length") and SOAP::Utils::bytelength($$data) == $_[2]->header("Content-Length")
!ll&&!rl&&r
000
MC/DC0%0/2
$_[2]->header("Content-Length") and SOAP::Utils::bytelength($$data) == $_[2]->header("Content-Length")
$_[2]->header("Content-Length") SOAP::Utils::bytelength($$data) == $_[2]->header("Content-Length")
Truth table0%0/3
A and B
A= $_[2]->header("Content-Length")B= SOAP::Utils::bytelength($$data) == $_[2]->header("Content-Length")
ABresult
0X0
100
111
59 0 my $done = 0;
60 $_[3] = sub {
61 0 ▶ $done++ ? &$next : $data;
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$done++ ? : 0 0 0
62 0 };
63 }
64 2 goto &$collect;
65 15 };
66 }
67 15 $_patched++;
68 }
69  
70 17 ▶sub DESTROY { SOAP::Trace::objects('()') }
Subroutine DESTROY: called CC=1 SCAR=0.0
71  
72 sub http_request {
73 32 ▶ my $self = shift;
Subroutine http_request: called CC=2 SCAR=6.9
74 32 ▶ if (@_) { $self->{'_http_request'} = shift; return $self }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 19 13 32
75 13 return $self->{'_http_request'};
76 }
77  
78 sub http_response {
79 184 ▶ my $self = shift;
Subroutine http_response: called CC=2 SCAR=6.9
80 184 ▶ if (@_) { $self->{'_http_response'} = shift; return $self }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 13 171 184
81 171 return $self->{'_http_response'};
82 }
83  
84 sub setDebugLogger {
85 18 ▶ my ($self,$logger) = @_;
Subroutine setDebugLogger: called CC=1 SCAR=0.0
86 18 $self->{debug_logger} = $logger;
87 }
88  
89 sub new {
90 19 ▶ my $class = shift;
Subroutine new: called CC=12 SCAR=24.9
91 #print "HTTP.pm DEBUG: in sub new\n";
92  
93 19 ▶ return $class if ref $class; # skip if we're already object...
Branch: 1 branch
BranchTrueFalseTotal
if ref $class 1 18 19
94  
95 18 ▶ if ( !grep { $_ eq $USERAGENT_CLASS } @ISA ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (grep {$_ eq $SOAP::Transport::HTTP::Client::USERAGENT_CLASS;} @SOAP::Transport::HTTP::Client::ISA) 15 3 18
96 15 push @ISA, $USERAGENT_CLASS;
97 }
98  
99 18 ▶ eval("require $USERAGENT_CLASS")
Branch: 1 branch
BranchTrueFalseTotal
eval "require $SOAP::Transport::HTTP::Client::USERAGENT_CLASS" or die "Could not load UserAgent class $SOAP::Transport::HTTP::Client::USERAGENT_CLASS: $@" 0 18 18
100 or die "Could not load UserAgent class $USERAGENT_CLASS: $@";
101  
102 18 require HTTP::Request;
103 18 require HTTP::Headers;
104  
105 18 ▶ patch() if $SOAP::Constants::PATCH_HTTP_KEEPALIVE;
Branch: 1 branch
BranchTrueFalseTotal
if $SOAP::Constants::PATCH_HTTP_KEEPALIVE 17 1 18
106  
107 18 my ( @params, @methods );
108 18 ▶ while (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 17 18 35
109 17 ▶ $class->can( $_[0] )
Branch: 1 branch
BranchTrueFalseTotal
$class->can($_[0]) ? : 17 0 17
110 ? push( @methods, shift() => shift )
111 : push( @params, shift );
112 }
113 18 my $self = $class->SUPER::new(@params);
114  
115 18 ▶ die
Branch: 1 branch
BranchTrueFalseTotal
unless $self->isa("LWP::UserAgent") 0 18 18
116 "SOAP::Transport::HTTP::Client must inherit from LWP::UserAgent, or one of its subclasses"
117 if !$self->isa("LWP::UserAgent");
118  
119 18 $self->agent( join '/', 'SOAP::Lite', 'Perl',
120 $SOAP::Transport::HTTP::VERSION );
121 18 $self->options( {} );
122  
123 18 $self->http_request( HTTP::Request->new() );
124  
125 18 ▶ while (@methods) {
Branch: 1 branch
BranchTrueFalseTotal
if (@methods) 17 18 35
126 17 my ( $method, $params ) = splice( @methods, 0, 2 );
127 # ssl_opts takes a hash, not a ref - see RT 107924
128 17 ▶ if (ref $params eq 'HASH' && $method eq 'ssl_opts') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $params eq "HASH" and $method eq "ssl_opts") 1 16 17
Condition66%2/3
ref $params eq "HASH" and $method eq "ssl_opts"
!ll&&!rl&&r
1601
MC/DC50%1/2
ref $params eq "HASH" and $method eq "ssl_opts"
ref $params eq "HASH" $method eq "ssl_opts"
Truth table66%2/3
A and B
A= ref $params eq "HASH"B= $method eq "ssl_opts"
ABresult
0X0
100
111
129 1 $self->$method( %$params );
130 1 next;
131 }
132 16 ▶ $self->$method( ref $params eq 'ARRAY' ? @$params : $params );
Branch: 1 branch
BranchTrueFalseTotal
ref $params eq 'ARRAY' ? : 1 15 16
133 }
134  
135 18 SOAP::Trace::objects('()');
136  
137 18 $self->setDebugLogger(\&SOAP::Trace::debug);
138  
139 18 return $self;
140 }
141  
142 sub send_receive {
143 12 ▶ my ( $self, %parameters ) = @_;
Subroutine send_receive: called CC=43 SCAR=51.9
144 my ( $context, $envelope, $endpoint, $action, $encoding, $parts ) =
145 12 @parameters{qw(context envelope endpoint action encoding parts)};
146  
147 12 ▶ $encoding ||= 'UTF-8';
Condition100%2/2
$encoding ||= "UTF-8"
l!l
111
MC/DC100%1/1
$encoding ||= "UTF-8"
$encoding
Truth table100%2/2
A
A= $encoding
Aresult
11
00
148  
149 12 ▶ $endpoint ||= $self->endpoint;
Condition66%2/3
$endpoint ||= $self->endpoint
l!l&&r!l&&!r
1110
MC/DC0%0/2
$endpoint ||= $self->endpoint
$endpoint $self->endpoint
Truth table66%2/3
A ||= B
A= $endpointB= $self->endpoint
ABresult
1X1
011
000
150  
151 12 my $method = 'POST';
152 12 $COMPRESS = 'gzip';
153  
154 $self->options->{is_compress} ||=
155 exists $self->options->{compress_threshold}
156 12 ▶ && eval { require Compress::Zlib };
Condition33%2/6
$self->options->{"is_compress"} ||= exists $self->options->{"compress_threshold"} && eval { do { require Compress::Zlib } }
l!l&&r!l&&!r
0012
exists $self->options->{'compress_threshold'} && eval { do { require Compress::Zlib } }
!ll&&!rl&&r
1200
MC/DC0%0/3
$self->options->{"is_compress"} ||= exists $self->options->{"compress_threshold"} && eval { do { require Compress::Zlib } }
$self->options->{"is_compress"} exists $self->options->{'compress_threshold'} eval { do { require Compress::Zlib } }
Truth table0%0/4
A ||= B && C
A= $self->options->{"is_compress"}B= exists $self->options->{'compress_threshold'}C= eval { do { require Compress::Zlib } }
ABCresult
1XX1
0111
00X0
0100
157  
158 # Initialize the basic about the HTTP Request object
159 12 my $http_request = $self->http_request()->clone();
160  
161 # $self->http_request(HTTP::Request->new);
162 12 $http_request->headers( HTTP::Headers->new );
163  
164 # TODO - add application/dime
165 12 $http_request->header(
166 Accept => ['text/xml', 'multipart/*', 'application/soap'] );
167 12 $http_request->method($method);
168 12 $http_request->url($endpoint);
169  
170 17 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
171 12 ▶ if ($parts) {
Branch: 1 branch
BranchTrueFalseTotal
if ($parts) 0 12 12
172 0 my $packager = $context->packager;
173 0 $envelope = $packager->package( $envelope, $context );
174 0 for my $hname ( keys %{$packager->headers_http} ) {
175 $http_request->headers->header(
176 0 $hname => $packager->headers_http->{$hname} );
177 }
178  
179 # TODO - DIME support
180 }
181  
182 COMPRESS: {
183 12 my $compressed =
184 !exists $nocompress{$endpoint}
185 && $self->options->{is_compress}
186 12 ▶ && ( $self->options->{compress_threshold} || 0 ) < length $envelope;
Condition25%2/8
!exists $nocompress{$endpoint} && $self->options->{'is_compress'} && ($self->options->{'compress_threshold'} || 0) < length $envelope
!ll&&!rl&&r
1200
not exists $nocompress{$endpoint} and $self->options->{"is_compress"}
!ll&&!rl&&r
0120
$self->options->{'compress_threshold'} || 0
l!l
00
MC/DC0%0/3
!exists $nocompress{$endpoint} && $self->options->{'is_compress'} && ($self->options->{'compress_threshold'} || 0) < length $envelope
not exists $nocompress{$endpoint} $self->options->{"is_compress"} $self->options->{'compress_threshold'}
Truth table25%1/4
not(A) and B && C
A= not exists $nocompress{$endpoint}B= $self->options->{"is_compress"}C= $self->options->{'compress_threshold'}
ABCresult
0XX0
10X0
1100
1111
187  
188  
189 12 my $original_encoding = $http_request->content_encoding;
190  
191 12 while (1) {
192  
193 # check cache for redirect
194 12 ▶ $endpoint = $redirect{$endpoint} if exists $redirect{$endpoint};
Branch: 1 branch
BranchTrueFalseTotal
if exists $redirect{$endpoint} 0 12 12
195  
196 # check cache for M-POST
197 12 ▶ $method = 'M-POST' if exists $mpost{$endpoint};
Branch: 1 branch
BranchTrueFalseTotal
if exists $mpost{$endpoint} 0 12 12
198  
199 # what's this all about?
200 # unfortunately combination of LWP and Perl 5.6.1 and later has bug
201 # in sending multibyte characters. LWP uses length() to calculate
202 # content-length header and starting 5.6.1 length() calculates chars
203 # instead of bytes. 'use bytes' in THIS file doesn't work, because
204 # it's lexically scoped. Unfortunately, content-length we calculate
205 # here doesn't work either, because LWP overwrites it with
206 # content-length it calculates (which is wrong) AND uses length()
207 # during syswrite/sysread, so we are in a bad shape anyway.
208 #
209 # what to do? we calculate proper content-length (using
210 # bytelength() function from SOAP::Utils) and then drop utf8 mark
211 # from string (doing pack with 'C0A*' modifier) if length and
212 # bytelength are not the same
213 12 my $bytelength = SOAP::Utils::bytelength($envelope);
214 12 ▶ if ($] < 5.008) {
Branch: 1 branch
BranchTrueFalseTotal
if ($] < 5.008) { } 0 12 12
215 0 $envelope = pack( 'C0A*', $envelope );
216 }
217 else {
218 12 require Encode;
219 12 $envelope = Encode::encode($encoding, $envelope);
220 }
221 # if !$SOAP::Constants::DO_NOT_USE_LWP_LENGTH_HACK
222 # && length($envelope) != $bytelength;
223  
224 # compress after encoding
225 # doing it before breaks the compressed content (#74577)
226 12 ▶ $envelope = Compress::Zlib::memGzip($envelope) if $compressed;
Branch: 1 branch
BranchTrueFalseTotal
if $compressed 0 12 12
227  
228 12 $http_request->content($envelope);
229 12 $http_request->protocol('HTTP/1.1');
230  
231 $http_request->proxy_authorization_basic( $ENV{'HTTP_proxy_user'},
232 $ENV{'HTTP_proxy_pass'} )
233 12 ▶ if ( $ENV{'HTTP_proxy_user'} && $ENV{'HTTP_proxy_pass'} );
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"HTTP_proxy_user"} and $ENV{"HTTP_proxy_pass"} 0 12 12
Condition33%1/3
$ENV{"HTTP_proxy_user"} and $ENV{"HTTP_proxy_pass"}
!ll&&!rl&&r
1200
MC/DC0%0/2
$ENV{"HTTP_proxy_user"} and $ENV{"HTTP_proxy_pass"}
$ENV{"HTTP_proxy_user"} $ENV{"HTTP_proxy_pass"}
Truth table33%1/3
A and B
A= $ENV{"HTTP_proxy_user"}B= $ENV{"HTTP_proxy_pass"}
ABresult
0X0
100
111
234  
235 # by Murray Nesbitt
236 12 ▶ if ( $method eq 'M-POST' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq 'M-POST') { } 0 12 12
237 0 my $prefix = sprintf '%04d', int( rand(1000) );
238 0 $http_request->header(
239 Man => qq!"$SOAP::Constants::NS_ENV"; ns=$prefix! );
240 0 ▶ $http_request->header( "$prefix-SOAPAction" => $action )
Branch: 1 branch
BranchTrueFalseTotal
if defined $action 0 0 0
241 if defined $action;
242 }
243 else {
244 12 ▶ $http_request->header( SOAPAction => $action )
Branch: 1 branch
BranchTrueFalseTotal
if defined $action 11 1 12
245 if defined $action;
246 }
247  
248 # $http_request->header(Expect => '100-Continue');
249  
250 # allow compress if present and let server know we could handle it
251 $http_request->header( 'Accept-Encoding' =>
252 [$SOAP::Transport::HTTP::Client::COMPRESS] )
253 12 ▶ if $self->options->{is_compress};
Branch: 1 branch
BranchTrueFalseTotal
if $self->options->{"is_compress"} 0 12 12
254  
255 12 ▶ $http_request->content_encoding(
Branch: 1 branch
BranchTrueFalseTotal
if $compressed 0 12 12
256 $SOAP::Transport::HTTP::Client::COMPRESS)
257 if $compressed;
258  
259 12 ▶ if ( !$http_request->content_type ) {
Branch: 2 branches
BranchTrueFalseTotal
if (not $http_request->content_type) { } 12 0 12
elsif (not $SOAP::Constants::DO_NOT_USE_CHARSET and $encoding) { } 0 0 0
260 12 ▶ $http_request->content_type(
Branch: 1 branch
BranchTrueFalseTotal
!$SOAP::Constants::DO_NOT_USE_CHARSET && $encoding ? : 11 1 12
Condition66%2/3
not $SOAP::Constants::DO_NOT_USE_CHARSET and $encoding
!ll&&!rl&&r
1011
MC/DC50%1/2
not $SOAP::Constants::DO_NOT_USE_CHARSET and $encoding
not $SOAP::Constants::DO_NOT_USE_CHARSET $encoding
Truth table66%2/3
not(A) and B
A= not $SOAP::Constants::DO_NOT_USE_CHARSETB= $encoding
ABresult
0X0
100
111
261 join '; ',
262 $SOAP::Constants::DEFAULT_HTTP_CONTENT_TYPE,
263 !$SOAP::Constants::DO_NOT_USE_CHARSET && $encoding
264 ? 'charset=' . lc($encoding)
265 : () );
266 }
267 ▶ elsif ( !$SOAP::Constants::DO_NOT_USE_CHARSET && $encoding ) {
Condition0%0/3
not $SOAP::Constants::DO_NOT_USE_CHARSET and $encoding
!ll&&!rl&&r
000
MC/DC0%0/2
not $SOAP::Constants::DO_NOT_USE_CHARSET and $encoding
not $SOAP::Constants::DO_NOT_USE_CHARSET $encoding
Truth table0%0/3
not(A) and B
A= not $SOAP::Constants::DO_NOT_USE_CHARSETB= $encoding
ABresult
0X0
100
111
268 0 my $tmpType = $http_request->headers->header('Content-type');
269  
270 # $http_request->content_type($tmpType.'; charset=' . lc($encoding));
271 0 my $addition = '; charset=' . lc($encoding);
272 0 ▶ $http_request->content_type( $tmpType . $addition )
Branch: 1 branch
BranchTrueFalseTotal
unless $tmpType =~ /$addition/ 0 0 0
273 if ( $tmpType !~ /$addition/ );
274 }
275  
276 12 ▶ $http_request->content_length($bytelength) unless $compressed;
Branch: 1 branch
BranchTrueFalseTotal
unless $compressed 12 0 12
277 12 SOAP::Trace::transport($http_request);
278 12 &{$self->{debug_logger}}($http_request->as_string);
279  
280 12 ▶ $self->SUPER::env_proxy if $ENV{'HTTP_proxy'};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"HTTP_proxy"} 0 12 12
281  
282 # send and receive the stuff.
283 # TODO maybe eval this? what happens on connection close?
284 12 $self->http_response( $self->SUPER::request($http_request) );
285 12 SOAP::Trace::transport( $self->http_response );
286 12 &{$self->{debug_logger}}($self->http_response->as_string);
287  
288 # 100 OK, continue to read?
289 12 ▶ if ( (
Branch: 2 branches
BranchTrueFalseTotal
if ($self->http_response->code == 510 || $self->http_response->code == 501 and $method ne 'M-POST') { } 0 12 12
elsif ($self->http_response->code == 415 and $compressed) { } 0 12 12
Condition33%2/6
$self->http_response->code == 510 || $self->http_response->code == 501 and $method ne "M-POST"
!ll&&!rl&&r
1200
$self->http_response->code == 510 or $self->http_response->code == 501
l!l&&r!l&&!r
0012
MC/DC0%0/3
$self->http_response->code == 510 || $self->http_response->code == 501 and $method ne "M-POST"
$self->http_response->code == 510 $self->http_response->code == 501 $method ne "M-POST"
Truth table20%1/5
A or B and C
A= $self->http_response->code == 510B= $self->http_response->code == 501C= $method ne "M-POST"
ABCresult
00X0
1X00
0100
1X11
0111
290 $self->http_response->code == 510
291 || $self->http_response->code == 501
292 )
293 && $method ne 'M-POST'
294 ) {
295 0 $mpost{$endpoint} = 1;
296 }
297 ▶ elsif ( $self->http_response->code == 415 && $compressed ) {
Condition33%1/3
$self->http_response->code == 415 and $compressed
!ll&&!rl&&r
1200
MC/DC0%0/2
$self->http_response->code == 415 and $compressed
$self->http_response->code == 415 $compressed
Truth table33%1/3
A and B
A= $self->http_response->code == 415B= $compressed
ABresult
0X0
100
111
298  
299 # 415 Unsupported Media Type
300 0 $nocompress{$endpoint} = 1;
301 0 $envelope = Compress::Zlib::memGunzip($envelope);
302 0 $http_request->headers->remove_header('Content-Encoding');
303 0 redo COMPRESS; # try again without compression
304 }
305 else {
306 12 last;
307 }
308 }
309 }
310  
311 12 ▶ $redirect{$endpoint} = $self->http_response->request->url
Branch: 1 branch
BranchTrueFalseTotal
if $self->http_response->previous and $self->http_response->previous->is_redirect 1 11 12
Condition66%2/3
$self->http_response->previous and $self->http_response->previous->is_redirect
!ll&&!rl&&r
1101
MC/DC50%1/2
$self->http_response->previous and $self->http_response->previous->is_redirect
$self->http_response->previous $self->http_response->previous->is_redirect
Truth table66%2/3
A and B
A= $self->http_response->previousB= $self->http_response->previous->is_redirect
ABresult
0X0
100
111
312 if $self->http_response->previous
313 && $self->http_response->previous->is_redirect;
314  
315 12 $self->code( $self->http_response->code );
316 12 $self->message( $self->http_response->message );
317 12 $self->is_success( $self->http_response->is_success );
318 12 $self->status( $self->http_response->status_line );
319  
320 # Pull out any cookies from the response headers
321 $self->{'_cookie_jar'}->extract_cookies( $self->http_response )
322 12 ▶ if $self->{'_cookie_jar'};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"_cookie_jar"} 0 12 12
323  
324 my $content =
325 ( $self->http_response->content_encoding || '' ) =~
326 /\b$SOAP::Transport::HTTP::Client::COMPRESS\b/o
327 && $self->options->{is_compress}
328 12 ▶ ? Compress::Zlib::memGunzip( $self->http_response->content )
Branch: 2 branches
BranchTrueFalseTotal
($self->http_response->content_encoding || '') =~ /\b$SOAP::Transport::HTTP::Client::COMPRESS\b/o && $self->options->{'is_compress'} ? : 0 12 12
($self->http_response->content_encoding || '') =~ /\S/ ? : 0 12 12
Condition42%3/7
($self->http_response->content_encoding || "") =~ /\b$SOAP::Transport::HTTP::Client::COMPRESS\b/o and $self->options->{"is_compress"}
!ll&&!rl&&r
1200
$self->http_response->content_encoding || ''
l!l
012
$self->http_response->content_encoding || ''
l!l
012
MC/DC0%0/2
($self->http_response->content_encoding || "") =~ /\b$SOAP::Transport::HTTP::Client::COMPRESS\b/o and $self->options->{"is_compress"}
$self->http_response->content_encoding $self->options->{"is_compress"}
Truth table33%1/3
A and B
A= $self->http_response->content_encodingB= $self->options->{"is_compress"}
ABresult
0X0
100
111
329 : ( $self->http_response->content_encoding || '' ) =~ /\S/ ? die
330 0 "Can't understand returned Content-Encoding (@{[$self->http_response->content_encoding]})\n"
331 : $self->http_response->content;
332  
333 12 ▶ return $self->http_response->content_type =~ m!^multipart/!i
Branch: 1 branch
BranchTrueFalseTotal
$self->http_response->content_type =~ m[^multipart/]i ? : 0 12 12
334 ? join( "\n", $self->http_response->headers_as_string, $content )
335 : $content;
336 }
337  
338 # ======================================================================
339  
340 package SOAP::Transport::HTTP::Server;
341  
342 17 ▶use vars qw(@ISA $COMPRESS);
Subroutine BEGIN: called CC=1 SCAR=0.0
343 17 @ISA = qw(SOAP::Server);
344  
345 17 ▶use URI;
Subroutine BEGIN: called CC=1 SCAR=0.0
346  
347 17 $COMPRESS = 'deflate';
348  
349 1 ▶sub DESTROY { SOAP::Trace::objects('()') }
Subroutine DESTROY: called CC=1 SCAR=0.0
350  
351 sub setDebugLogger {
352 5 ▶ my ($self,$logger) = @_;
Subroutine setDebugLogger: called CC=1 SCAR=0.0
353 5 $self->{debug_logger} = $logger;
354 }
355  
356 sub new {
357 23 ▶ require LWP::UserAgent;
Subroutine new: called CC=2 SCAR=8.1
358 23 my $self = shift;
359 23 ▶ return $self if ref $self; # we're already an object
Branch: 1 branch
BranchTrueFalseTotal
if ref $self 18 5 23
360  
361 5 my $class = $self;
362 5 $self = $class->SUPER::new(@_);
363 $self->{'_on_action'} = sub {
364 1 ▶ ( my $action = shift || '' ) =~ s/^(\"?)(.*)\1$/$2/;
Subroutine __ANON__: called CC=7 SCAR=29.6
Condition50%1/2
shift() || ''
l!l
01
MC/DC0%0/1
shift() || ''
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
365 1 ▶ die
Branch: 1 branch
BranchTrueFalseTotal
if $action and $action ne join("#", @_) and $action ne join("/", @_) and substr($_[0], -1, 1) ne "/" || $action ne join("", @_) 0 1 1
Condition25%3/12
$action and $action ne join("#", @_) and $action ne join("/", @_) and substr($_[0], -1, 1) ne "/" || $action ne join("", @_)
!ll&&!rl&&r
100
$action and $action ne join("#", @_) and $action ne join("/", @_)
!ll&&!rl&&r
100
$action and $action ne join("#", @_)
!ll&&!rl&&r
100
substr($_[0], -1, 1) ne "/" or $action ne join("", @_)
l!l&&r!l&&!r
000
MC/DC0%0/5
$action and $action ne join("#", @_) and $action ne join("/", @_) and substr($_[0], -1, 1) ne "/" || $action ne join("", @_)
$action $action ne join("#", @_) $action ne join("/", @_) substr($_[0], -1, 1) ne "/" $action ne join("", @_)
Truth table16%1/6
A and B and C and D or E
A= $actionB= $action ne join("#", @_)C= $action ne join("/", @_)D= substr($_[0], -1, 1) ne "/"E= $action ne join("", @_)
ABCDEresult
0XXXX0
10XXX0
110XX0
111000
1111X1
111011
366 0 "SOAPAction shall match 'uri#method' if present (got '$action', expected '@{[join('#', @_)]}'\n"
367 if $action
368 && $action ne join( '#', @_ )
369 && $action ne join( '/', @_ )
370 && ( substr( $_[0], -1, 1 ) ne '/'
371 || $action ne join( '', @_ ) );
372 5 };
373 5 SOAP::Trace::objects('()');
374  
375 5 $self->setDebugLogger(\&SOAP::Trace::debug);
376  
377 5 return $self;
378 }
379  
380 sub BEGIN {
381 17 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
382 17 ▶ for my $method (qw(request response)) {
Subroutine BEGIN: called CC=2 SCAR=6.9
383 34 my $field = '_' . $method;
384 *$method = sub {
385 27 ▶ my $self = shift->new;
Subroutine __ANON__: called CC=2 SCAR=6.9
386 @_
387 ? ( $self->{$field} = shift, return $self )
388 27 ▶ : return $self->{$field};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 6 21 27
389 34 };
390 }
391 }
392  
393 sub handle {
394 1 ▶ my $self = shift->new;
Subroutine handle: called CC=26 SCAR=48.5
395  
396 1 &{$self->{debug_logger}}($self->request->content);
397  
398 1 ▶ if ( $self->request->method eq 'POST' ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($self->request->method eq 'POST') { } 1 0 1
elsif ($self->request->method eq 'M-POST') { } 0 0 0
399 1 ▶ $self->action( $self->request->header('SOAPAction') || undef );
Condition50%1/2
$self->request->header('SOAPAction') || undef
l!l
01
MC/DC0%0/1
$self->request->header('SOAPAction') || undef
$self->request->header('SOAPAction')
Truth table50%1/2
A
A= $self->request->header('SOAPAction')
Aresult
11
00
400 }
401 elsif ( $self->request->method eq 'M-POST' ) {
402 0 ▶ return $self->response(
Branch: 1 branch
BranchTrueFalseTotal
unless $self->request->header("Man") =~ /^"$SOAP::Constants::NS_ENV";\s*ns\s*=\s*(\d+)/ 0 0 0
403 HTTP::Response->new(
404 510, # NOT EXTENDED
405 "Expected Mandatory header with $SOAP::Constants::NS_ENV as unique URI"
406 ) )
407 if $self->request->header('Man') !~
408 /^"$SOAP::Constants::NS_ENV";\s*ns\s*=\s*(\d+)/;
409 0 ▶ $self->action( $self->request->header("$1-SOAPAction") || undef );
Condition0%0/2
$self->request->header("$1-SOAPAction") || undef
l!l
00
MC/DC0%0/1
$self->request->header("$1-SOAPAction") || undef
$self->request->header("$1-SOAPAction")
Truth table0%0/2
A
A= $self->request->header("$1-SOAPAction")
Aresult
11
00
410 }
411 else {
412 0 return $self->response(
413 HTTP::Response->new(405) ) # METHOD NOT ALLOWED
414 }
415  
416 1 ▶ my $compressed =
Condition50%1/2
$self->request->content_encoding || ''
l!l
01
MC/DC0%0/1
$self->request->content_encoding || ''
$self->request->content_encoding
Truth table50%1/2
A
A= $self->request->content_encoding
Aresult
11
00
417 ( $self->request->content_encoding || '' ) =~ /\b$COMPRESS\b/;
418 $self->options->{is_compress} ||=
419 1 ▶ $compressed && eval { require Compress::Zlib };
Condition33%2/6
$self->options->{"is_compress"} ||= $compressed && eval { do { require Compress::Zlib } }
l!l&&r!l&&!r
001
$compressed && eval { do { require Compress::Zlib } }
!ll&&!rl&&r
100
MC/DC0%0/3
$self->options->{"is_compress"} ||= $compressed && eval { do { require Compress::Zlib } }
$self->options->{"is_compress"} $compressed eval { do { require Compress::Zlib } }
Truth table0%0/4
A ||= B && C
A= $self->options->{"is_compress"}B= $compressedC= eval { do { require Compress::Zlib } }
ABCresult
1XX1
0111
00X0
0100
420  
421 # signal error if content-encoding is 'deflate', but we don't want it OR
422 # something else, so we don't understand it
423 return $self->response(
424 HTTP::Response->new(415) ) # UNSUPPORTED MEDIA TYPE
425 if $compressed && !$self->options->{is_compress}
426 1 ▶ || !$compressed
Branch: 1 branch
BranchTrueFalseTotal
if $compressed and not $self->options->{"is_compress"} or not $compressed and ($self->request->content_encoding || "") =~ /\S/ 0 1 1
Condition36%4/11
$compressed and not $self->options->{"is_compress"} or not $compressed and ($self->request->content_encoding || "") =~ /\S/
l!l&&r!l&&!r
001
$compressed and not $self->options->{"is_compress"}
!ll&&!rl&&r
100
not $compressed and ($self->request->content_encoding || "") =~ /\S/
!ll&&!rl&&r
010
$self->request->content_encoding || ''
l!l
01
MC/DC0%0/4
$compressed and not $self->options->{"is_compress"} or not $compressed and ($self->request->content_encoding || "") =~ /\S/
$compressed not $self->options->{"is_compress"} not $compressed $self->request->content_encoding
Truth table14%1/7
A and not(B) or not(C) and D
A= $compressedB= not $self->options->{"is_compress"}C= not $compressedD= $self->request->content_encoding
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
427 && ( $self->request->content_encoding || '' ) =~ /\S/;
428  
429 1 ▶ my $content_type = $self->request->content_type || '';
Condition50%1/2
$self->request->content_type || ''
l!l
01
MC/DC0%0/1
$self->request->content_type || ''
$self->request->content_type
Truth table50%1/2
A
A= $self->request->content_type
Aresult
11
00
430  
431 # in some environments (PerlEx?) content_type could be empty, so allow it also
432 # anyway it'll blow up inside ::Server::handle if something wrong with message
433 # TBD: but what to do with MIME encoded messages in THOSE environments?
434 1 ▶ return $self->make_fault( $SOAP::Constants::FAULT_CLIENT,
Branch: 1 branch
BranchTrueFalseTotal
if not $SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPE and $content_type and $content_type ne "application/soap+xml" and $content_type ne "text/xml" and $content_type ne "application/dime" and not $content_type =~ m[^multipart/] 0 1 1
Condition33%5/15
not $SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPE and $content_type and $content_type ne "application/soap+xml" and $content_type ne "text/xml" and $content_type ne "application/dime" and not $content_type =~ m[^multipart/]
!ll&&!rl&&r
100
not $SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPE and $content_type and $content_type ne "application/soap+xml" and $content_type ne "text/xml" and $content_type ne "application/dime"
!ll&&!rl&&r
100
not $SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPE and $content_type and $content_type ne "application/soap+xml" and $content_type ne "text/xml"
!ll&&!rl&&r
100
not $SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPE and $content_type and $content_type ne "application/soap+xml"
!ll&&!rl&&r
100
not $SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPE and $content_type
!ll&&!rl&&r
010
MC/DC0%0/6
not $SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPE and $content_type and $content_type ne "application/soap+xml" and $content_type ne "text/xml" and $content_type ne "application/dime" and not $content_type =~ m[^multipart/]
not $SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPE $content_type $content_type ne "application/soap+xml" $content_type ne "text/xml" $content_type ne "application/dime" not $content_type =~ m[^multipart/]
Truth table14%1/7
not(A) and B and C and D and E and not(F)
A= not $SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPEB= $content_typeC= $content_type ne "application/soap+xml"D= $content_type ne "text/xml"E= $content_type ne "application/dime"F= not $content_type =~ m[^multipart/]
ABCDEFresult
0XXXXX0
10XXXX0
110XXX0
1110XX0
11110X0
1111100
1111111
435 "Content-Type must be 'text/xml,' 'multipart/*,' "
436 . "'application/soap+xml,' 'or 'application/dime' instead of '$content_type'"
437 )
438 if !$SOAP::Constants::DO_NOT_CHECK_CONTENT_TYPE
439 && $content_type
440 && $content_type ne 'application/soap+xml'
441 && $content_type ne 'text/xml'
442 && $content_type ne 'application/dime'
443 && $content_type !~ m!^multipart/!;
444  
445 # TODO - Handle the Expect: 100-Continue HTTP/1.1 Header
446 1 ▶ if ( defined( $self->request->header("Expect") )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->request->header("Expect") and $self->request->header("Expect") eq "100-Continue") 0 1 1
Condition33%1/3
defined $self->request->header("Expect") and $self->request->header("Expect") eq "100-Continue"
!ll&&!rl&&r
100
MC/DC0%0/2
defined $self->request->header("Expect") and $self->request->header("Expect") eq "100-Continue"
defined $self->request->header("Expect") $self->request->header("Expect") eq "100-Continue"
Truth table33%1/3
A and B
A= defined $self->request->header("Expect")B= $self->request->header("Expect") eq "100-Continue"
ABresult
0X0
100
111
447 && ( $self->request->header("Expect") eq "100-Continue" ) ) {
448  
449 }
450  
451 # TODO - this should query SOAP::Packager to see what types it supports,
452 # I don't like how this is hardcoded here.
453 1 ▶ my $content =
Branch: 1 branch
BranchTrueFalseTotal
$compressed ? : 0 1 1
454 $compressed
455 ? Compress::Zlib::uncompress( $self->request->content )
456 : $self->request->content;
457  
458 1 ▶ my $response = $self->SUPER::handle(
Branch: 2 branches
BranchTrueFalseTotal
my $response = $self->SUPER::handle($self->request->content_type =~ m[^multipart/] ? join("\n", $self->request->headers_as_string, $content) : $content) or return 0 1 1
$self->request->content_type =~ m[^multipart/] ? : 0 1 1
459 $self->request->content_type =~ m!^multipart/!
460 ? join( "\n", $self->request->headers_as_string, $content )
461 : $content
462 ) or return;
463  
464 1 &{$self->{debug_logger}}($response);
465  
466 1 $self->make_response( $SOAP::Constants::HTTP_ON_SUCCESS_CODE, $response );
467 }
468  
469 sub make_fault {
470 2 ▶ my $self = shift;
Subroutine make_fault: called CC=1 SCAR=0.0
471 2 $self->make_response(
472 $SOAP::Constants::HTTP_ON_FAULT_CODE => $self->SUPER::make_fault(@_)
473 );
474 2 return;
475 }
476  
477 sub make_response {
478 3 ▶ my ( $self, $code, $response ) = @_;
Subroutine make_response: called CC=14 SCAR=35.2
479  
480 3 ▶ my $encoding = $1
Branch: 1 branch
BranchTrueFalseTotal
if $response =~ /^<\?xml(?: version="1.0"| encoding="([^\"]+)")+\?>/ 3 0 3
481 if $response =~ /^<\?xml(?: version="1.0"| encoding="([^\"]+)")+\?>/;
482  
483 3 ▶ $response =~ s!(\?>)!$1<?xml-stylesheet type="text/css"?>!
Branch: 1 branch
BranchTrueFalseTotal
if $self->request->content_type eq "multipart/form-data" 0 3 3
484 if $self->request->content_type eq 'multipart/form-data';
485  
486 $self->options->{is_compress} ||=
487 exists $self->options->{compress_threshold}
488 3 ▶ && eval { require Compress::Zlib };
Condition33%2/6
$self->options->{"is_compress"} ||= exists $self->options->{"compress_threshold"} && eval { do { require Compress::Zlib } }
l!l&&r!l&&!r
003
exists $self->options->{'compress_threshold'} && eval { do { require Compress::Zlib } }
!ll&&!rl&&r
300
MC/DC0%0/3
$self->options->{"is_compress"} ||= exists $self->options->{"compress_threshold"} && eval { do { require Compress::Zlib } }
$self->options->{"is_compress"} exists $self->options->{'compress_threshold'} eval { do { require Compress::Zlib } }
Truth table0%0/4
A ||= B && C
A= $self->options->{"is_compress"}B= exists $self->options->{'compress_threshold'}C= eval { do { require Compress::Zlib } }
ABCresult
1XX1
0111
00X0
0100
489  
490 my $compressed = $self->options->{is_compress}
491 && grep( /\b($COMPRESS|\*)\b/,
492 $self->request->header('Accept-Encoding') )
493 3 ▶ && ( $self->options->{compress_threshold} || 0 ) <
Condition25%2/8
$self->options->{'is_compress'} && grep(/\b($SOAP::Transport::HTTP::Server::COMPRESS|\*)\b/, $self->request->header('Accept-Encoding')) && ($self->options->{'compress_threshold'} || 0) < SOAP::Utils::bytelength($response)
!ll&&!rl&&r
300
$self->options->{"is_compress"} and grep /\b($SOAP::Transport::HTTP::Server::COMPRESS|\*)\b/, $self->request->header("Accept-Encoding")
!ll&&!rl&&r
300
$self->options->{'compress_threshold'} || 0
l!l
00
MC/DC0%0/3
$self->options->{'is_compress'} && grep(/\b($SOAP::Transport::HTTP::Server::COMPRESS|\*)\b/, $self->request->header('Accept-Encoding')) && ($self->options->{'compress_threshold'} || 0) < SOAP::Utils::bytelength($response)
$self->options->{"is_compress"} grep /\b($SOAP::Transport::HTTP::Server::COMPRESS|\*)\b/, $self->request->header("Accept-Encoding") $self->options->{'compress_threshold'}
Truth table25%1/4
A and B && C
A= $self->options->{"is_compress"}B= grep /\b($SOAP::Transport::HTTP::Server::COMPRESS|\*)\b/, $self->request->header("Accept-Encoding")C= $self->options->{'compress_threshold'}
ABCresult
0XX0
10X0
1100
1111
494 SOAP::Utils::bytelength $response;
495  
496 3 ▶ $response = Compress::Zlib::compress($response) if $compressed;
Branch: 1 branch
BranchTrueFalseTotal
if $compressed 0 3 3
497  
498 # this next line does not look like a good test to see if something is multipart
499 # perhaps a /content-type:.*multipart\//gi is a better regex?
500 3 my ($is_multipart) =
501 ( $response =~ /^content-type:.* boundary="([^\"]*)"/im );
502  
503 $self->response(
504 HTTP::Response->new(
505 $code => undef,
506 HTTP::Headers->new(
507 'SOAPServer' => $self->product_tokens,
508 $compressed ? ( 'Content-Encoding' => $COMPRESS ) : (),
509 'Content-Type' => join( '; ',
510 'text/xml',
511 !$SOAP::Constants::DO_NOT_USE_CHARSET
512 && $encoding ? 'charset=' . lc($encoding) : () ),
513 'Content-Length' => SOAP::Utils::bytelength $response
514 ),
515 ( $] > 5.007 )
516 3 ▶ ? do { require Encode; Encode::encode( $encoding, $response ) }
Branch: 3 branches
BranchTrueFalseTotal
$compressed ? : 0 3 3
!$SOAP::Constants::DO_NOT_USE_CHARSET && $encoding ? : 3 0 3
$] > 5.007 ? : 3 0 3
Condition33%1/3
not $SOAP::Constants::DO_NOT_USE_CHARSET and $encoding
!ll&&!rl&&r
003
MC/DC0%0/2
not $SOAP::Constants::DO_NOT_USE_CHARSET and $encoding
not $SOAP::Constants::DO_NOT_USE_CHARSET $encoding
Truth table33%1/3
not(A) and B
A= not $SOAP::Constants::DO_NOT_USE_CHARSETB= $encoding
ABresult
0X0
100
111
517 : $response,
518 ) );
519  
520 3 ▶ $self->response->headers->header( 'Content-Type' =>
Branch: 1 branch
BranchTrueFalseTotal
if $is_multipart 0 3 3
521 'Multipart/Related; type="text/xml"; start="<main_envelope>"; boundary="'
522 . $is_multipart
523 . '"' )
524 if $is_multipart;
525 }
526  
527 # ->VERSION leaks a scalar every call - no idea why.
528 sub product_tokens {
529 4 ▶ join '/', 'SOAP::Lite', 'Perl', $SOAP::Transport::HTTP::VERSION;
Subroutine product_tokens: called CC=1 SCAR=0.0
530 }
531  
532 # ======================================================================
533  
534 package SOAP::Transport::HTTP::CGI;
535  
536 17 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
537 17 @ISA = qw(SOAP::Transport::HTTP::Server);
538  
539 2 ▶sub DESTROY { SOAP::Trace::objects('()') }
Subroutine DESTROY: called CC=1 SCAR=0.0
540  
541 sub new {
542 62 ▶ my $self = shift;
Subroutine new: called CC=3 SCAR=11.2
543 62 ▶ return $self if ref $self;
Branch: 1 branch
BranchTrueFalseTotal
if ref $self 59 3 62
544  
545 3 ▶ my $class = ref($self) || $self;
Condition33%1/3
ref $self || $self
l!l&&r!l&&!r
030
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table33%1/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
546 3 $self = $class->SUPER::new(@_);
547 3 SOAP::Trace::objects('()');
548  
549 3 return $self;
550 }
551  
552 sub make_response {
553 2 ▶ my $self = shift;
Subroutine make_response: called CC=1 SCAR=0.0
554 2 $self->SUPER::make_response(@_);
555 }
556  
557 sub handle {
558 1 ▶ my $self = shift->new;
Subroutine handle: called CC=23 SCAR=46.0
559  
560 1 ▶ my $length = $ENV{'CONTENT_LENGTH'} || 0;
Condition50%1/2
$ENV{'CONTENT_LENGTH'} || 0
l!l
10
MC/DC0%0/1
$ENV{'CONTENT_LENGTH'} || 0
$ENV{'CONTENT_LENGTH'}
Truth table50%1/2
A
A= $ENV{'CONTENT_LENGTH'}
Aresult
11
00
561  
562 # if the HTTP_TRANSFER_ENCODING env is defined, set $chunked if it's chunked*
563 # else to false
564 my $chunked = (defined $ENV{'HTTP_TRANSFER_ENCODING'}
565 1 ▶ && $ENV{'HTTP_TRANSFER_ENCODING'} =~ /^chunked.*$/) || 0;
Condition40%2/5
defined $ENV{'HTTP_TRANSFER_ENCODING'} && $ENV{'HTTP_TRANSFER_ENCODING'} =~ /^chunked.*$/ || 0
l!l
01
defined $ENV{"HTTP_TRANSFER_ENCODING"} and $ENV{"HTTP_TRANSFER_ENCODING"} =~ /^chunked.*$/
!ll&&!rl&&r
100
MC/DC0%0/2
defined $ENV{'HTTP_TRANSFER_ENCODING'} && $ENV{'HTTP_TRANSFER_ENCODING'} =~ /^chunked.*$/ || 0
defined $ENV{"HTTP_TRANSFER_ENCODING"} $ENV{"HTTP_TRANSFER_ENCODING"} =~ /^chunked.*$/
Truth table33%1/3
A and B
A= defined $ENV{"HTTP_TRANSFER_ENCODING"}B= $ENV{"HTTP_TRANSFER_ENCODING"} =~ /^chunked.*$/
ABresult
111
0X0
100
566  
567  
568 1 my $content = q{};
569  
570 1 ▶ if ($chunked) {
Branch: 1 branch
BranchTrueFalseTotal
if ($chunked) 0 1 1
571 0 my $buffer;
572 0 binmode(STDIN);
573 0 ▶ while ( read( STDIN, my $buffer, 1024 ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (read STDIN, my $buffer, 1024) 0 0 0
574 0 $content .= $buffer;
575 }
576 0 $length = length($content);
577 }
578  
579 1 ▶ if ( !$length ) {
Branch: 2 branches
BranchTrueFalseTotal
if (not $length) { } 0 1 1
elsif (defined $SOAP::Constants::MAX_CONTENT_SIZE and $length > $SOAP::Constants::MAX_CONTENT_SIZE) { } 0 1 1
580 0 $self->response( HTTP::Response->new(411) ) # LENGTH REQUIRED
581 }
582 ▶ elsif ( defined $SOAP::Constants::MAX_CONTENT_SIZE
Condition33%1/3
defined $SOAP::Constants::MAX_CONTENT_SIZE and $length > $SOAP::Constants::MAX_CONTENT_SIZE
!ll&&!rl&&r
100
MC/DC0%0/2
defined $SOAP::Constants::MAX_CONTENT_SIZE and $length > $SOAP::Constants::MAX_CONTENT_SIZE
defined $SOAP::Constants::MAX_CONTENT_SIZE $length > $SOAP::Constants::MAX_CONTENT_SIZE
Truth table33%1/3
A and B
A= defined $SOAP::Constants::MAX_CONTENT_SIZEB= $length > $SOAP::Constants::MAX_CONTENT_SIZE
ABresult
0X0
100
111
583 && $length > $SOAP::Constants::MAX_CONTENT_SIZE ) {
584 0 $self->response( HTTP::Response->new(413) ) # REQUEST ENTITY TOO LARGE
585 }
586 else {
587 1 ▶ if ( exists $ENV{EXPECT} && $ENV{EXPECT} =~ /\b100-Continue\b/i ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $ENV{"EXPECT"} and $ENV{"EXPECT"} =~ /\b100-Continue\b/i) 0 1 1
Condition33%1/3
exists $ENV{"EXPECT"} and $ENV{"EXPECT"} =~ /\b100-Continue\b/i
!ll&&!rl&&r
100
MC/DC0%0/2
exists $ENV{"EXPECT"} and $ENV{"EXPECT"} =~ /\b100-Continue\b/i
exists $ENV{"EXPECT"} $ENV{"EXPECT"} =~ /\b100-Continue\b/i
Truth table33%1/3
A and B
A= exists $ENV{"EXPECT"}B= $ENV{"EXPECT"} =~ /\b100-Continue\b/i
ABresult
0X0
100
111
588 0 print "HTTP/1.1 100 Continue\r\n\r\n";
589 }
590  
591 #my $content = q{};
592 1 ▶ if ( !$chunked ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($chunked) 1 0 1
593 1 my $buffer;
594 1 binmode(STDIN);
595 1 ▶ if ( defined $ENV{'MOD_PERL'} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ENV{'MOD_PERL'}) { } 0 1 1
596 0 ▶ while ( read( STDIN, $buffer, $length ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (read STDIN, $buffer, $length) 0 0 0
597 0 $content .= $buffer;
598 0 ▶ last if ( length($content) >= $length );
Branch: 1 branch
BranchTrueFalseTotal
if length $content >= $length 0 0 0
599 }
600 } else {
601 1 ▶ while ( sysread( STDIN, $buffer, $length ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (sysread STDIN, $buffer, $length) 1 0 1
602 1 $content .= $buffer;
603 1 ▶ last if ( length($content) >= $length );
Branch: 1 branch
BranchTrueFalseTotal
if length $content >= $length 1 0 1
604 }
605 }
606 }
607  
608 $self->request(
609 HTTP::Request->new(
610 $ENV{'REQUEST_METHOD'} || '' => $ENV{'SCRIPT_NAME'},
611 HTTP::Headers->new(
612 1 ▶ map { (
Condition50%1/2
$ENV{'REQUEST_METHOD'} || ''
l!l
10
MC/DC0%0/1
$ENV{'REQUEST_METHOD'} || ''
$ENV{'REQUEST_METHOD'}
Truth table50%1/2
A
A= $ENV{'REQUEST_METHOD'}
Aresult
11
00
613 /^HTTP_(.+)/i
614 ? ( $1 =~ m/SOAPACTION/ )
615 ? ('SOAPAction')
616 : ($1)
617 : $_
618 32 ▶ ) => $ENV{$_}
Branch: 2 branches
BranchTrueFalseTotal
/^HTTP_(.+)/i ? : 0 32 32
$1 =~ /SOAPACTION/ ? : 0 0 0
619 } keys %ENV
620 ),
621 $content,
622 ) );
623 1 $self->SUPER::handle;
624 }
625  
626 # imitate nph- cgi for IIS (pointed by Murray Nesbitt)
627 my $status =
628 defined( $ENV{'SERVER_SOFTWARE'} )
629 && $ENV{'SERVER_SOFTWARE'} =~ /IIS/
630 1 ▶ ? $ENV{SERVER_PROTOCOL} || 'HTTP/1.0'
Branch: 1 branch
BranchTrueFalseTotal
defined $ENV{'SERVER_SOFTWARE'} && $ENV{'SERVER_SOFTWARE'} =~ /IIS/ ? : 0 1 1
Condition20%1/5
defined $ENV{"SERVER_SOFTWARE"} and $ENV{"SERVER_SOFTWARE"} =~ /IIS/
!ll&&!rl&&r
100
$ENV{"SERVER_PROTOCOL"} or "HTTP/1.0"
l!l
00
MC/DC0%0/2
defined $ENV{"SERVER_SOFTWARE"} and $ENV{"SERVER_SOFTWARE"} =~ /IIS/
defined $ENV{"SERVER_SOFTWARE"} $ENV{"SERVER_SOFTWARE"} =~ /IIS/
MC/DC0%0/1
$ENV{"SERVER_PROTOCOL"} or "HTTP/1.0"
$ENV{"SERVER_PROTOCOL"}
Truth table33%1/3
A and B
A= defined $ENV{"SERVER_SOFTWARE"}B= $ENV{"SERVER_SOFTWARE"} =~ /IIS/
ABresult
0X0
100
111
Truth table0%0/2
A
A= $ENV{"SERVER_PROTOCOL"}
Aresult
11
00
631 : 'Status:';
632 1 my $code = $self->response->code;
633  
634 1 binmode(STDOUT);
635  
636 1 print STDOUT "$status $code ", HTTP::Status::status_message($code),
637 "\015\012", $self->response->headers_as_string("\015\012"), "\015\012",
638 $self->response->content;
639 }
640  
641 # ======================================================================
642  
643 package SOAP::Transport::HTTP::Daemon;
644  
645 17 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
646 17 ▶use vars qw($AUTOLOAD @ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
647 17 @ISA = qw(SOAP::Transport::HTTP::Server);
648  
649 1 ▶sub DESTROY { SOAP::Trace::objects('()') }
Subroutine DESTROY: called CC=1 SCAR=0.0
650  
651 #sub new { require HTTP::Daemon;
652 sub new {
653 17 ▶ my $self = shift;
Subroutine new: called CC=11 SCAR=30.2
654 17 ▶ return $self if ( ref $self );
Branch: 1 branch
BranchTrueFalseTotal
if ref $self 16 1 17
655  
656 1 my $class = $self;
657  
658 1 my ( @params, @methods );
659 1 ▶ while (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 1 1
660 0 ▶ $class->can( $_[0] )
Branch: 1 branch
BranchTrueFalseTotal
$class->can($_[0]) ? : 0 0 0
661 ? push( @methods, shift() => shift )
662 : push( @params, shift );
663 }
664 1 $self = $class->SUPER::new;
665  
666 # Added in 0.65 - Thanks to Nils Sowen
667 # use SSL if there is any parameter with SSL_* in the name
668 1 ▶ $self->SSL(1) if !$self->SSL && grep /^SSL_/, @params;
Branch: 1 branch
BranchTrueFalseTotal
if not $self->SSL and grep /^SSL_/, @params 0 1 1
Condition33%1/3
not $self->SSL and grep /^SSL_/, @params
!ll&&!rl&&r
010
MC/DC0%0/2
not $self->SSL and grep /^SSL_/, @params
not $self->SSL grep /^SSL_/, @params
Truth table33%1/3
not(A) and B
A= not $self->SSLB= grep /^SSL_/, @params
ABresult
0X0
100
111
669 1 my $http_daemon = $self->http_daemon_class;
670 1 ▶ eval "require $http_daemon"
Branch: 1 branch
BranchTrueFalseTotal
unless $http_daemon->can("new") 1 0 1
Condition33%2/6
$http_daemon->can('new') || (eval "require $http_daemon" || Carp::croak($@))
l!l&&r!l&&!r
010
eval "require $http_daemon" or Carp::croak($@)
l!l&&r!l&&!r
100
MC/DC0%0/3
$http_daemon->can('new') || (eval "require $http_daemon" || Carp::croak($@))
$http_daemon->can('new') eval "require $http_daemon" Carp::croak($@)
Truth table0%0/4
A || B or C
A= $http_daemon->can('new')B= eval "require $http_daemon"C= Carp::croak($@)
ABCresult
1XX1
01X1
0011
0000
671 or Carp::croak $@
672 unless $http_daemon->can('new');
673  
674 1 ▶ $self->{_daemon} = $http_daemon->new(@params)
Branch: 1 branch
BranchTrueFalseTotal
$self->{"_daemon"} = $http_daemon->new(@params) or Carp::croak("Can't create daemon: $!") 0 1 1
675 or Carp::croak "Can't create daemon: $!";
676  
677 # End SSL patch
678  
679 1 $self->myuri( URI->new( $self->url )->canonical->as_string );
680  
681 1 ▶ while (@methods) {
Branch: 1 branch
BranchTrueFalseTotal
if (@methods) 0 1 1
682 0 my ( $method, $params ) = splice( @methods, 0, 2 );
683 0 ▶ $self->$method(
Branch: 1 branch
BranchTrueFalseTotal
ref $params eq 'ARRAY' ? : 0 0 0
684 ref $params eq 'ARRAY'
685 ? @$params
686 : $params
687 );
688 }
689 1 SOAP::Trace::objects('()');
690  
691 1 return $self;
692 }
693  
694 sub SSL {
695 8 ▶ my $self = shift->new;
Subroutine SSL: called CC=2 SCAR=6.9
696 8 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 2 6 8
697 2 $self->{_SSL} = shift;
698 2 return $self;
699 }
700 6 return $self->{_SSL};
701 }
702  
703 3 ▶sub http_daemon_class { shift->SSL ? 'HTTP::Daemon::SSL' : 'HTTP::Daemon' }
Subroutine http_daemon_class: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
(shift())->SSL ? : 1 2 3
704  
705 sub AUTOLOAD {
706 1 ▶ my $method = substr( $AUTOLOAD, rindex( $AUTOLOAD, '::' ) + 2 );
Subroutine AUTOLOAD: called CC=2 SCAR=7.0
707 1 ▶ return if $method eq 'DESTROY';
Branch: 1 branch
BranchTrueFalseTotal
if $method eq "DESTROY" 0 1 1
708  
709 17 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
710 1 ▶ *$AUTOLOAD = sub { shift->{_daemon}->$method(@_) };
Subroutine __ANON__: called CC=1 SCAR=0.0
711 1 goto &$AUTOLOAD;
712 }
713  
714 sub handle {
715 0 ▶ my $self = shift->new;
Subroutine handle: not called CC=6 SCAR=37.4
716 0 ▶ while ( my $c = $self->accept ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $c = $self->accept) 0 0 0
717 0 ▶ while ( my $r = $c->get_request ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $r = $c->get_request) 0 0 0
718 0 $self->request($r);
719 0 $self->SUPER::handle;
720 0 eval {
721 0 ▶ local $SIG{PIPE} = sub {die "SIGPIPE"};
Subroutine __ANON__: not called CC=1 SCAR=6.9
722 0 $c->send_response( $self->response );
723 };
724 0 ▶ if ($@ && $@ !~ /^SIGPIPE/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@ and not $@ =~ /^SIGPIPE/) 0 0 0
Condition0%0/3
$@ and not $@ =~ /^SIGPIPE/
!ll&&!rl&&r
000
MC/DC0%0/2
$@ and not $@ =~ /^SIGPIPE/
$@ not $@ =~ /^SIGPIPE/
Truth table0%0/3
A and not(B)
A= $@B= not $@ =~ /^SIGPIPE/
ABresult
0X0
100
111
725 0 die $@;
726 }
727 }
728  
729 # replaced ->close, thanks to Sean Meisner <Sean.Meisner@VerizonWireless.com>
730 # shutdown() doesn't work on AIX. close() is used in this case. Thanks to Jos Clijmans <jos.clijmans@recyfin.be>
731 0 ▶ $c->can('shutdown')
Branch: 1 branch
BranchTrueFalseTotal
$c->can('shutdown') ? : 0 0 0
732 ? $c->shutdown(2)
733 : $c->close();
734 0 $c->close;
735 }
736 }
737  
738 # ======================================================================
739  
740 package SOAP::Transport::HTTP::Apache;
741  
742 17 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
743 17 @ISA = qw(SOAP::Transport::HTTP::Server);
744  
745 0 ▶sub DESTROY { SOAP::Trace::objects('()') }
Subroutine DESTROY: not called CC=1 SCAR=6.9
746  
747 sub new {
748 0 ▶ my $self = shift;
Subroutine new: not called CC=8 SCAR=42.8
749 0 ▶ unless ( ref $self ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $self) 0 0 0
750 0 ▶ my $class = ref($self) || $self;
Condition0%0/3
ref $self || $self
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table0%0/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
751 0 $self = $class->SUPER::new(@_);
752 0 SOAP::Trace::objects('()');
753 }
754  
755 # Added this code thanks to JT Justman
756 # This code improves and provides more robust support for
757 # multiple versions of Apache and mod_perl
758  
759 # mod_perl 2.0
760 0 ▶ if ( defined $ENV{MOD_PERL_API_VERSION}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ENV{'MOD_PERL_API_VERSION'} and $ENV{'MOD_PERL_API_VERSION'} >= 2) { } 0 0 0
Condition0%0/3
defined $ENV{"MOD_PERL_API_VERSION"} and $ENV{"MOD_PERL_API_VERSION"} >= 2
!ll&&!rl&&r
000
MC/DC0%0/2
defined $ENV{"MOD_PERL_API_VERSION"} and $ENV{"MOD_PERL_API_VERSION"} >= 2
defined $ENV{"MOD_PERL_API_VERSION"} $ENV{"MOD_PERL_API_VERSION"} >= 2
Truth table0%0/3
A and B
A= defined $ENV{"MOD_PERL_API_VERSION"}B= $ENV{"MOD_PERL_API_VERSION"} >= 2
ABresult
0X0
100
111
761 && $ENV{MOD_PERL_API_VERSION} >= 2 ) {
762 0 require Apache2::RequestRec;
763 0 require Apache2::RequestIO;
764 0 require Apache2::Const;
765 0 require Apache2::RequestUtil;
766 0 require APR::Table;
767 0 Apache2::Const->import( -compile => 'OK' );
768 0 Apache2::Const->import( -compile => 'HTTP_BAD_REQUEST' );
769 0 $self->{'MOD_PERL_VERSION'} = 2;
770 0 $self->{OK} = &Apache2::Const::OK;
771 }
772 else { # mod_perl 1.xx
773 0 ▶ die "Could not find or load mod_perl"
Branch: 1 branch
BranchTrueFalseTotal
unless eval "require mod_perl" 0 0 0
774 unless ( eval "require mod_perl" );
775 0 ▶ die "Could not detect your version of mod_perl"
Branch: 1 branch
BranchTrueFalseTotal
unless defined $mod_perl::VERSION 0 0 0
776 if ( !defined($mod_perl::VERSION) );
777 0 ▶ if ( $mod_perl::VERSION < 1.99 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($mod_perl::VERSION < 1.99) { } 0 0 0
778 0 require Apache;
779 0 require Apache::Constants;
780 0 Apache::Constants->import('OK');
781 0 Apache::Constants->import('HTTP_BAD_REQUEST');
782 0 $self->{'MOD_PERL_VERSION'} = 1;
783 0 $self->{OK} = &Apache::Constants::OK;
784 }
785 else {
786 0 require Apache::RequestRec;
787 0 require Apache::RequestIO;
788 0 require Apache::Const;
789 0 Apache::Const->import( -compile => 'OK' );
790 0 Apache::Const->import( -compile => 'HTTP_BAD_REQUEST' );
791 0 $self->{'MOD_PERL_VERSION'} = 1.99;
792 0 $self->{OK} = &Apache::OK;
793 }
794 }
795  
796 0 return $self;
797 }
798  
799 sub handler {
800 0 ▶ my $self = shift->new;
Subroutine handler: not called CC=10 SCAR=47.0
801 0 my $r = shift;
802  
803 # Begin patch from JT Justman
804 0 ▶ if ( !$r ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($r) 0 0 0
805 0 ▶ if ( $self->{'MOD_PERL_VERSION'} < 2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'MOD_PERL_VERSION'} < 2) { } 0 0 0
806 0 $r = Apache->request();
807 }
808 else {
809 0 $r = Apache2::RequestUtil->request();
810 }
811 }
812  
813 0 my $cont_len;
814 0 ▶ if ( $self->{'MOD_PERL_VERSION'} < 2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'MOD_PERL_VERSION'} < 2) { } 0 0 0
815 0 $cont_len = $r->header_in('Content-length');
816 }
817 else {
818 0 $cont_len = $r->headers_in->get('Content-length');
819 }
820  
821 # End patch from JT Justman
822  
823 0 my $content = "";
824 0 ▶ if ( $cont_len > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cont_len > 0) { } 0 0 0
825 0 my $buf;
826  
827 # attempt to slurp in the content at once...
828 0 ▶ $content .= $buf while ( $r->read( $buf, $cont_len ) > 0 );
Branch: 1 branch
BranchTrueFalseTotal
$r->read($buf, $cont_len) > 0 and do { $content .= $buf } 0 0 0
829 }
830 else {
831  
832 # throw appropriate error for mod_perl 2
833 return Apache2::Const::HTTP_BAD_REQUEST()
834 0 ▶ if ( $self->{'MOD_PERL_VERSION'} >= 2 );
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"MOD_PERL_VERSION"} >= 2 0 0 0
835 0 return Apache::Constants::BAD_REQUEST();
836 }
837  
838 0 my %headers;
839 0 ▶ if ( $self->{'MOD_PERL_VERSION'} < 2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'MOD_PERL_VERSION'} < 2) { } 0 0 0
840 0 %headers = $r->headers_in; # Apache::Table structure
841 } else {
842 0 %headers = %{ $r->headers_in }; # Apache2::RequestRec structure
843 }
844  
845 0 $self->request(
846 HTTP::Request->new(
847 $r->method() => $r->uri,
848 HTTP::Headers->new( %headers ),
849 $content
850 ) );
851 0 $self->SUPER::handle;
852  
853 # we will specify status manually for Apache, because
854 # if we do it as it has to be done, returning SERVER_ERROR,
855 # Apache will modify our content_type to 'text/html; ....'
856 # which is not what we want.
857 # will emulate normal response, but with custom status code
858 # which could also be 500.
859 0 ▶ if ($self->{'MOD_PERL_VERSION'} < 2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'MOD_PERL_VERSION'} < 2) { } 0 0 0
860 0 $r->status( $self->response->code );
861 }
862 else {
863 0 $r->status_line($self->response->code);
864 }
865  
866 # Begin JT Justman patch
867 0 ▶ if ( $self->{'MOD_PERL_VERSION'} > 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'MOD_PERL_VERSION'} > 1) { } 0 0 0
868 0 ▶ $self->response->headers->scan(sub { $r->headers_out->add(@_) });
Subroutine __ANON__: not called CC=1 SCAR=6.9
869 0 $r->content_type( join '; ', $self->response->content_type );
870 }
871 else {
872 0 ▶ $self->response->headers->scan( sub { $r->header_out(@_) } );
Subroutine __ANON__: not called CC=1 SCAR=6.9
873 0 $r->send_http_header( join '; ', $self->response->content_type );
874 }
875  
876 0 $r->print( $self->response->content );
877 0 return $self->{OK};
878  
879 # End JT Justman patch
880 }
881  
882 sub configure {
883 0 ▶ my $self = shift->new;
Subroutine configure: not called CC=5 SCAR=34.0
884 0 my $config = shift->dir_config;
885 0 for (%$config) {
886 $config->{$_} =~ /=>/
887 ? $self->$_( {split /\s*(?:=>|,)\s*/, $config->{$_}} )
888 : ref $self->$_() ? () # hm, nothing can be done here
889 0 ▶ : $self->$_( split /\s+|\s*,\s*/, $config->{$_} )
Branch: 3 branches
BranchTrueFalseTotal
if $self->can($_) 0 0 0
$config->{$_} =~ /=>/ ? : 0 0 0
ref $self->$_ ? : 0 0 0
890 if $self->can($_);
891 }
892 0 return $self;
893 }
894  
895 {
896  
897 # just create alias
898 17 sub handle;
899 17 *handle = \&handler
900 }
901  
902 # ======================================================================
903 #
904 # Copyright (C) 2001 Single Source oy (marko.asplund@kronodoc.fi)
905 # a FastCGI transport class for SOAP::Lite.
906 # Updated formatting and removed dead code in new() in 2008
907 # by Martin Kutter
908 #
909 # ======================================================================
910  
911 package SOAP::Transport::HTTP::FCGI;
912  
913 17 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
914 17 @ISA = qw(SOAP::Transport::HTTP::CGI);
915  
916 1 ▶sub DESTROY { SOAP::Trace::objects('()') }
Subroutine DESTROY: called CC=1 SCAR=0.0
917  
918 sub new {
919  
920 7 ▶ require FCGI;
Subroutine new: called CC=2 SCAR=6.9
921 7 Exporter::require_version( 'FCGI' => 0.47 )
922 ; # requires thread-safe interface
923  
924 7 my $class = shift;
925 7 ▶ return $class if ref $class;
Branch: 1 branch
BranchTrueFalseTotal
if ref $class 6 1 7
926  
927 1 my $self = $class->SUPER::new(@_);
928 1 $self->{_fcgirq} = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR );
929 1 SOAP::Trace::objects('()');
930  
931 1 return $self;
932 }
933  
934 sub handle {
935 0 ▶ my $self = shift->new;
Subroutine handle: not called CC=2 SCAR=17.9
936  
937 0 my ( $r1, $r2 );
938 0 my $fcgirq = $self->{_fcgirq};
939  
940 0 ▶ while ( ( $r1 = $fcgirq->Accept() ) >= 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (($r1 = $fcgirq->Accept) >= 0) 0 0 0
941 0 $r2 = $self->SUPER::handle;
942 }
943  
944 0 return undef;
945 }
946  
947 # ======================================================================
948  
949 17 1;
« lib/SOAP/Test.pm ↑ Summary lib/SOAP/Transport/POP3.pm »