line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AnyEvent::Ident::Transaction; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
28
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
117
|
|
4
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
94
|
|
5
|
4
|
|
|
4
|
|
20
|
use AnyEvent::Ident::Response; |
|
4
|
|
|
|
|
40
|
|
|
4
|
|
|
|
|
1047
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Simple asynchronous ident transaction |
8
|
|
|
|
|
|
|
our $VERSION = '0.08'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
9
|
|
|
9
|
1
|
71
|
sub req { shift->{req} } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub reply_with_user |
15
|
|
|
|
|
|
|
{ |
16
|
4
|
|
|
4
|
1
|
63
|
my $self = shift; |
17
|
4
|
|
|
|
|
10
|
my $username = pop; |
18
|
4
|
|
|
|
|
9
|
my $os = shift; |
19
|
4
|
50
|
|
|
|
14
|
$os = 'OTHER' unless defined $os; |
20
|
|
|
|
|
|
|
$self->{cb}->( |
21
|
|
|
|
|
|
|
AnyEvent::Ident::Response->new( |
22
|
|
|
|
|
|
|
req => $self->{req}, |
23
|
4
|
|
|
|
|
33
|
username => $username, |
24
|
|
|
|
|
|
|
os => $os, |
25
|
|
|
|
|
|
|
) |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub reply_with_error |
31
|
|
|
|
|
|
|
{ |
32
|
3
|
|
|
3
|
1
|
20
|
my($self, $error_type) = @_; |
33
|
|
|
|
|
|
|
$self->{cb}->( |
34
|
|
|
|
|
|
|
AnyEvent::Ident::Response->new( |
35
|
|
|
|
|
|
|
req => $self->{req}, |
36
|
3
|
|
|
|
|
12
|
error_type => $error_type, |
37
|
|
|
|
|
|
|
) |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
1
|
|
sub remote_port { shift->{remote_port} } |
43
|
0
|
|
|
0
|
1
|
|
sub local_port { shift->{local_port} } |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
0
|
1
|
|
sub remote_address { shift->{remote_address} } |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |