line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::RPC::CustomUA;
|
2
|
1
|
|
|
1
|
|
16605
|
use base qw(XML::RPC);
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
708
|
|
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
12470
|
use 5.010;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
45
|
|
5
|
1
|
|
|
1
|
|
5
|
use strict;
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
32
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
208
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = 0.9;
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub call {
|
11
|
0
|
|
|
0
|
1
|
|
my $self = shift;
|
12
|
0
|
|
|
|
|
|
my ( $methodname, @params ) = @_;
|
13
|
|
|
|
|
|
|
|
14
|
0
|
0
|
|
|
|
|
die 'no url' if ( !$self->{url} );
|
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my $xml_out = $self->create_call_xml( $methodname, @params );
|
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
$self->{xml_out} = $xml_out;
|
19
|
|
|
|
|
|
|
|
20
|
0
|
0
|
|
|
|
|
my ( $result, $xml_in ) = $self->{tpp}->parsehttp(
|
21
|
|
|
|
|
|
|
POST => $self->{url},
|
22
|
|
|
|
|
|
|
$xml_out,
|
23
|
|
|
|
|
|
|
{
|
24
|
|
|
|
|
|
|
'Content-Type' => 'text/xml',
|
25
|
|
|
|
|
|
|
'User-Agent' => defined($self->{tpp}->{'User-Agent'}) ? $self->{tpp}->{'User-Agent'} : 'XML-RPC/' . $VERSION,
|
26
|
|
|
|
|
|
|
'Content-Length' => length($xml_out)
|
27
|
|
|
|
|
|
|
}
|
28
|
|
|
|
|
|
|
);
|
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
$self->{xml_in} = $xml_in;
|
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my @data = $self->unparse_response($result);
|
33
|
0
|
0
|
|
|
|
|
return @data == 1 ? $data[0] : @data;
|
34
|
|
|
|
|
|
|
}
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Preloaded methods go here.
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program.
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1;
|
42
|
|
|
|
|
|
|
__END__
|