line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::IMP::Remote::Storable; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1457
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
86
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
47
|
|
5
|
2
|
|
|
2
|
|
8
|
use Net::IMP::Remote::Protocol; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
156
|
|
6
|
2
|
|
|
2
|
|
8
|
use Net::IMP qw(:DEFAULT :log); |
|
2
|
|
|
|
|
20
|
|
|
2
|
|
|
|
|
374
|
|
7
|
2
|
|
|
2
|
|
10
|
use Net::IMP::Debug; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
14
|
|
8
|
2
|
|
|
2
|
|
1114
|
use Net::IMP::Remote::DualvarMapping; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
117
|
|
9
|
2
|
|
|
2
|
|
715
|
use Storable (); |
|
2
|
|
|
|
|
2605
|
|
|
2
|
|
|
|
|
555
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $wire_version = 0x00000001; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
1
|
|
|
1
|
0
|
574
|
bless {}, shift; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub buf2rpc { |
18
|
46
|
|
|
46
|
0
|
4565
|
my ($self,$rdata) = @_; |
19
|
46
|
100
|
|
|
|
103
|
decode: |
20
|
|
|
|
|
|
|
return if length($$rdata)<6; |
21
|
42
|
|
|
|
|
94
|
my ($len) = unpack("x2L",$$rdata); |
22
|
42
|
100
|
|
|
|
107
|
return if length($$rdata) - 6 < $len; |
23
|
12
|
|
|
|
|
40
|
my ($op,$args) = unpack("SL/a*",$$rdata); |
24
|
12
|
|
|
|
|
33
|
substr($$rdata,0,$len+6,''); |
25
|
12
|
|
|
|
|
33
|
$args = Storable::thaw($args); |
26
|
12
|
100
|
|
|
|
231
|
if ( $op == IMPRPC_SET_VERSION ) { |
27
|
1
|
50
|
|
|
|
2
|
die "wrong version $args->[0], can do $wire_version only" |
28
|
|
|
|
|
|
|
if $args->[0] != $wire_version; |
29
|
1
|
50
|
|
|
|
4
|
return if $$rdata eq ''; |
30
|
0
|
|
|
|
|
0
|
goto decode; |
31
|
|
|
|
|
|
|
} |
32
|
11
|
|
|
|
|
46
|
return rpc_i2d([$op,@$args]); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub rpc2buf { |
36
|
12
|
|
|
12
|
0
|
26348
|
my ($self,$rpc) = @_; |
37
|
12
|
|
|
|
|
22
|
my ($op,@args) = @{ rpc_d2i($rpc) }; |
|
12
|
|
|
|
|
40
|
|
38
|
12
|
|
|
|
|
52
|
return pack("SL/a*",$op,Storable::nfreeze(\@args)); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub init { |
42
|
1
|
|
|
1
|
0
|
547
|
my ($self,$side) = @_; |
43
|
1
|
50
|
|
|
|
4
|
return if $side == 0; |
44
|
1
|
|
|
|
|
4
|
$self->rpc2buf([IMPRPC_SET_VERSION,$wire_version]) |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |