line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one |
3
|
|
|
|
|
|
|
# or more contributor license agreements. See the NOTICE file |
4
|
|
|
|
|
|
|
# distributed with this work for additional information |
5
|
|
|
|
|
|
|
# regarding copyright ownership. The ASF licenses this file |
6
|
|
|
|
|
|
|
# to you under the Apache License, Version 2.0 (the |
7
|
|
|
|
|
|
|
# "License"); you may not use this file except in compliance |
8
|
|
|
|
|
|
|
# with the License. You may obtain a copy of the License at |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, |
13
|
|
|
|
|
|
|
# software distributed under the License is distributed on an |
14
|
|
|
|
|
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
15
|
|
|
|
|
|
|
# KIND, either express or implied. See the License for the |
16
|
|
|
|
|
|
|
# specific language governing permissions and limitations |
17
|
|
|
|
|
|
|
# under the License. |
18
|
|
|
|
|
|
|
# |
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
3
|
|
36
|
use 5.10.0; |
|
3
|
|
|
|
|
10
|
|
21
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
89
|
|
22
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
90
|
|
23
|
|
|
|
|
|
|
|
24
|
3
|
|
|
3
|
|
17
|
use Thrift; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
61
|
|
25
|
3
|
|
|
3
|
|
14
|
use Thrift::Exception; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
139
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# |
28
|
|
|
|
|
|
|
# Transport exceptions |
29
|
|
|
|
|
|
|
# |
30
|
|
|
|
|
|
|
package Thrift::TTransportException; |
31
|
3
|
|
|
3
|
|
17
|
use base('Thrift::TException'); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1015
|
|
32
|
3
|
|
|
3
|
|
22
|
use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); |
|
3
|
|
|
|
|
44
|
|
|
3
|
|
|
|
|
16
|
|
33
|
|
|
|
|
|
|
|
34
|
3
|
|
|
3
|
|
317
|
use constant UNKNOWN => 0; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
168
|
|
35
|
3
|
|
|
3
|
|
20
|
use constant NOT_OPEN => 1; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
133
|
|
36
|
3
|
|
|
3
|
|
21
|
use constant ALREADY_OPEN => 2; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
150
|
|
37
|
3
|
|
|
3
|
|
19
|
use constant TIMED_OUT => 3; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
174
|
|
38
|
3
|
|
|
3
|
|
19
|
use constant END_OF_FILE => 4; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
336
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub new { |
41
|
1
|
|
|
1
|
|
2
|
my $classname = shift; |
42
|
1
|
|
|
|
|
8
|
my $self = $classname->SUPER::new(@_); |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
10
|
return bless($self,$classname); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
package Thrift::Transport; |
48
|
3
|
|
|
3
|
|
21
|
use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); |
|
3
|
|
|
|
|
47
|
|
|
3
|
|
|
|
|
25
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# |
51
|
|
|
|
|
|
|
# Whether this transport is open. |
52
|
|
|
|
|
|
|
# |
53
|
|
|
|
|
|
|
# @return boolean true if open |
54
|
|
|
|
|
|
|
# |
55
|
|
|
|
|
|
|
sub isOpen |
56
|
|
|
|
|
|
|
{ |
57
|
0
|
|
|
0
|
0
|
|
die 'abstract'; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# |
61
|
|
|
|
|
|
|
# Open the transport for reading/writing |
62
|
|
|
|
|
|
|
# |
63
|
|
|
|
|
|
|
# @throws TTransportException if cannot open |
64
|
|
|
|
|
|
|
# |
65
|
|
|
|
|
|
|
sub open |
66
|
|
|
|
|
|
|
{ |
67
|
0
|
|
|
0
|
0
|
|
die 'abstract'; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# |
71
|
|
|
|
|
|
|
# Close the transport. |
72
|
|
|
|
|
|
|
# |
73
|
|
|
|
|
|
|
sub close |
74
|
|
|
|
|
|
|
{ |
75
|
0
|
|
|
0
|
0
|
|
die 'abstract'; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# |
79
|
|
|
|
|
|
|
# Read some data into the array. |
80
|
|
|
|
|
|
|
# |
81
|
|
|
|
|
|
|
# @param int $len How much to read |
82
|
|
|
|
|
|
|
# @return string The data that has been read |
83
|
|
|
|
|
|
|
# @throws TTransportException if cannot read any more data |
84
|
|
|
|
|
|
|
# |
85
|
|
|
|
|
|
|
sub read |
86
|
|
|
|
|
|
|
{ |
87
|
0
|
|
|
0
|
0
|
|
die 'abstract'; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
# |
91
|
|
|
|
|
|
|
# Guarantees that the full amount of data is read. |
92
|
|
|
|
|
|
|
# |
93
|
|
|
|
|
|
|
# @return string The data, of exact length |
94
|
|
|
|
|
|
|
# @throws TTransportException if cannot read data |
95
|
|
|
|
|
|
|
# |
96
|
|
|
|
|
|
|
sub readAll |
97
|
|
|
|
|
|
|
{ |
98
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
99
|
0
|
|
|
|
|
|
my $len = shift; |
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
my $data = ''; |
102
|
0
|
|
|
|
|
|
my $got = 0; |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
while (($got = length($data)) < $len) { |
105
|
0
|
|
|
|
|
|
$data .= $self->read($len - $got); |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
0
|
|
|
|
|
|
return $data; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# |
112
|
|
|
|
|
|
|
# Writes the given data out. |
113
|
|
|
|
|
|
|
# |
114
|
|
|
|
|
|
|
# @param string $buf The data to write |
115
|
|
|
|
|
|
|
# @throws TTransportException if writing fails |
116
|
|
|
|
|
|
|
# |
117
|
|
|
|
|
|
|
sub write |
118
|
|
|
|
|
|
|
{ |
119
|
0
|
|
|
0
|
0
|
|
die 'abstract'; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
# |
123
|
|
|
|
|
|
|
# Flushes any pending data out of a buffer |
124
|
|
|
|
|
|
|
# |
125
|
|
|
|
|
|
|
# @throws TTransportException if a writing error occurs |
126
|
|
|
|
|
|
|
# |
127
|
|
|
|
0
|
0
|
|
sub flush {} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
# |
131
|
|
|
|
|
|
|
# TransportFactory creates transport objects from transports |
132
|
|
|
|
|
|
|
# |
133
|
|
|
|
|
|
|
package Thrift::TransportFactory; |
134
|
3
|
|
|
3
|
|
870
|
use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); |
|
3
|
|
|
|
|
39
|
|
|
3
|
|
|
|
|
17
|
|
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
sub new { |
137
|
0
|
|
|
0
|
|
|
my $classname = shift; |
138
|
0
|
|
|
|
|
|
my $self = {}; |
139
|
|
|
|
|
|
|
|
140
|
0
|
|
|
|
|
|
return bless($self,$classname); |
141
|
|
|
|
|
|
|
} |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
# |
144
|
|
|
|
|
|
|
# Build a transport from the base transport |
145
|
|
|
|
|
|
|
# |
146
|
|
|
|
|
|
|
# @return Thrift::Transport transport |
147
|
|
|
|
|
|
|
# |
148
|
|
|
|
|
|
|
sub getTransport |
149
|
|
|
|
|
|
|
{ |
150
|
0
|
|
|
0
|
|
|
my $self = shift; |
151
|
0
|
|
|
|
|
|
my $trans = shift; |
152
|
|
|
|
|
|
|
|
153
|
0
|
|
|
|
|
|
return $trans; |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
# |
158
|
|
|
|
|
|
|
# ServerTransport base class module |
159
|
|
|
|
|
|
|
# |
160
|
|
|
|
|
|
|
package Thrift::ServerTransport; |
161
|
3
|
|
|
3
|
|
588
|
use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); |
|
3
|
|
|
|
|
39
|
|
|
3
|
|
|
|
|
15
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
sub listen |
164
|
|
|
|
|
|
|
{ |
165
|
0
|
|
|
0
|
|
|
die 'abstract'; |
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub accept |
169
|
|
|
|
|
|
|
{ |
170
|
0
|
|
|
0
|
|
|
die 'abstract'; |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
sub close |
174
|
|
|
|
|
|
|
{ |
175
|
0
|
|
|
0
|
|
|
die 'abstract'; |
176
|
|
|
|
|
|
|
} |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
1; |
180
|
|
|
|
|
|
|
|