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
|
|
95
|
use v5.26; |
|
9
|
|
|
|
|
26
|
|
7
|
9
|
|
|
9
|
|
39
|
use Object::Pad 0.41; |
|
9
|
|
|
|
|
95
|
|
|
9
|
|
|
|
|
38
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Tangence::Server::Context 0.29; |
10
|
|
|
|
|
|
|
class Tangence::Server::Context; |
11
|
|
|
|
|
|
|
|
12
|
9
|
|
|
9
|
|
2533
|
use Carp; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
515
|
|
13
|
|
|
|
|
|
|
|
14
|
9
|
|
|
9
|
|
53
|
use Tangence::Constants; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
5471
|
|
15
|
|
|
|
|
|
|
|
16
|
23
|
|
|
23
|
0
|
43
|
has $stream :param :reader; |
|
23
|
|
|
|
|
108
|
|
17
|
|
|
|
|
|
|
has $token :param; |
18
|
|
|
|
|
|
|
|
19
|
95
|
|
|
|
|
146
|
sub BUILDARGS ( $class, $stream, $token ) |
|
95
|
|
|
|
|
120
|
|
20
|
95
|
|
|
95
|
0
|
149
|
{ |
|
95
|
|
|
|
|
115
|
|
|
95
|
|
|
|
|
116
|
|
21
|
95
|
|
|
|
|
485
|
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
|
|
180
|
{ |
29
|
95
|
50
|
|
|
|
515
|
$responded or croak "$self never responded"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
95
|
|
|
|
|
157
|
method respond ( $message ) |
|
95
|
|
|
|
|
126
|
|
|
95
|
|
|
|
|
112
|
|
33
|
95
|
|
|
95
|
0
|
207
|
{ |
34
|
95
|
50
|
|
|
|
200
|
$responded and croak "$self has responded once already"; |
35
|
|
|
|
|
|
|
|
36
|
95
|
|
|
|
|
360
|
$stream->respond( $token, $message ); |
37
|
|
|
|
|
|
|
|
38
|
95
|
|
|
|
|
3074
|
$responded = 1; |
39
|
|
|
|
|
|
|
|
40
|
95
|
|
|
|
|
368
|
return; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
6
|
|
|
|
|
8
|
method responderr ( $msg ) |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
6
|
|
44
|
6
|
|
|
6
|
0
|
14
|
{ |
45
|
6
|
|
|
|
|
11
|
chomp $msg; # In case of simple ->responderr( $@ ); |
46
|
|
|
|
|
|
|
|
47
|
6
|
|
|
|
|
24
|
$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; |