line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# You may distribute under the terms of either the GNU General Public License |
2
|
|
|
|
|
|
|
# or the Artistic License (the same terms as Perl itself) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# (C) Paul Evans, 2010-2021 -- leonerd@leonerd.org.uk |
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
9
|
|
105
|
use v5.26; |
|
9
|
|
|
|
|
26
|
|
7
|
9
|
|
|
9
|
|
47
|
use Object::Pad 0.41; |
|
9
|
|
|
|
|
137
|
|
|
9
|
|
|
|
|
47
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Tangence::Server::Context 0.28; |
10
|
|
|
|
|
|
|
class Tangence::Server::Context; |
11
|
|
|
|
|
|
|
|
12
|
9
|
|
|
9
|
|
2638
|
use Carp; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
1360
|
|
13
|
|
|
|
|
|
|
|
14
|
9
|
|
|
9
|
|
55
|
use Tangence::Constants; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
5638
|
|
15
|
|
|
|
|
|
|
|
16
|
23
|
|
|
23
|
0
|
48
|
has $stream :param :reader; |
|
23
|
|
|
|
|
106
|
|
17
|
|
|
|
|
|
|
has $token :param; |
18
|
|
|
|
|
|
|
|
19
|
95
|
|
|
|
|
133
|
sub BUILDARGS ( $class, $stream, $token ) |
|
95
|
|
|
|
|
131
|
|
20
|
95
|
|
|
95
|
0
|
153
|
{ |
|
95
|
|
|
|
|
143
|
|
|
95
|
|
|
|
|
119
|
|
21
|
95
|
|
|
|
|
479
|
return ( stream => $stream, token => $token ); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has $responded; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# TODO: Object::Pad probably should do this bit |
27
|
|
|
|
|
|
|
method DESTROY |
28
|
95
|
|
|
95
|
|
210
|
{ |
29
|
95
|
50
|
|
|
|
566
|
$responded or croak "$self never responded"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
95
|
|
|
|
|
126
|
method respond ( $message ) |
|
95
|
|
|
|
|
132
|
|
|
95
|
|
|
|
|
120
|
|
33
|
95
|
|
|
95
|
0
|
215
|
{ |
34
|
95
|
50
|
|
|
|
210
|
$responded and croak "$self has responded once already"; |
35
|
|
|
|
|
|
|
|
36
|
95
|
|
|
|
|
380
|
$stream->respond( $token, $message ); |
37
|
|
|
|
|
|
|
|
38
|
95
|
|
|
|
|
3473
|
$responded = 1; |
39
|
|
|
|
|
|
|
|
40
|
95
|
|
|
|
|
385
|
return; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
6
|
|
|
|
|
8
|
method responderr ( $msg ) |
|
6
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
7
|
|
44
|
6
|
|
|
6
|
0
|
14
|
{ |
45
|
6
|
|
|
|
|
10
|
chomp $msg; # In case of simple ->responderr( $@ ); |
46
|
|
|
|
|
|
|
|
47
|
6
|
|
|
|
|
23
|
$self->respond( Tangence::Message->new( $stream, MSG_ERROR ) |
48
|
|
|
|
|
|
|
->pack_str( $msg ) |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 AUTHOR |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Paul Evans |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
0x55AA; |