line |
l |
!l |
condition |
108
|
0 |
0 |
$$self{'lock2key'} ||= sub {
my $self = shift() if ref $_[0];
my($lock) = @_;
$lock = &Encode::encode($$self{'charset_protocol'}, $lock, &Encode::FB_WARN()) if $$self{'charset_protocol'};
my(@lock) = split(//, $lock, 0);
my $i;
my(@key) = ();
foreach $_ (@lock) {
$_ = ord $_;
};
push @key, $lock[0] ^ 5;
for ($i = 1; $i < @lock; ++$i) {
push @key, $lock[$i] ^ $lock[$i - 1];
};
for ($i = 0; $i < @key; ++$i) {
$key[$i] = ($key[$i] << 4 & 240 | $key[$i] >> 4 & 15) & 255;
};
$key[0] = $key[0] ^ $key[@key - 1];
foreach $_ (@key) {
if ($_ == 0 or $_ == 5 or $_ == 36 or $_ == 96 or $_ == 124 or $_ == 126) {
$_ = sprintf('/%%DCN%03i%%/', $_);
}
else {
$_ = chr $_;
};
};
local $_ = join('', @key);
$_ = &Encode::decode($$self{'charset_protocol'}, $_) if $$self{'charset_protocol'};
return $_;
}
|
112
|
0 |
0 |
$$self{'tag'} ||= sub {
my $self = shift();
$$self{'client'} . ' ' . join(',', map(($_ . ':' . $$self{$_}), grep(defined($$self{$_}), ('V', 'M', 'H', 'S', 'O'))));
}
|
123
|
0 |
0 |
$$self{'myinfo'} ||= sub {
my $self = shift();
return $$self{'Nick'} . ' ' . $$self{'description'} . '<' . $self->tag . '>' . '$' . ' ' . '$' . $$self{'connection'} . (length $$self{'flag'} ? chr $$self{'flag'} : '') . '$' . $$self{'email'} . '$' . $$self{'sharesize'} . '$';
}
|
127
|
0 |
0 |
$$self{'supports'} ||= sub {
my $self = shift();
return join(' ', grep($$self{$_}, @{$$self{'supports_avail'};}));
}
|
134
|
0 |
0 |
$$self{'supports_parse'} ||= sub {
my $self = shift();
my($str, $save) = @_;
$$save{$_} = 1 foreach (split(/\s+/, $str, 0));
delete $$save{$_} foreach (grep((!length($$save{$_})), keys %$save));
return wantarray ? %$save : $save;
}
|
145
|
0 |
0 |
$$self{'info_parse'} ||= sub {
my $self = shift();
my($info, $save) = @_;
$$save{'info'} = $info;
$$save{'description'} = $1 if $info =~ s/^([^<\$]+)(<|\$)/$2/;
($$save{'tag'}, $$save{'M'}, $$save{'connection'}, $$save{'email'}, $$save{'sharesize'}) = split(/\s*\$\s*/, $info, 6);
$$save{'flag'} = ord $1 if $$save{'connection'} =~ s/([\x00-\x1F])$/();/e;
$self->tag_parse($$save{'tag'}, $save);
delete $$save{$_} foreach (grep((!length($$save{$_})), keys %$save));
return wantarray ? %$save : $save;
}
|
154
|
0 |
0 |
$$self{'tag_parse'} ||= sub {
my $self = shift();
my($tag, $save) = @_;
$$save{'tag'} = $tag;
$tag =~ s/(^\s*<\s*)|(\s*>\s*$)//g;
$$save{'client'} = $1 if $tag =~ s/^(\S+)\s*//;
/(.+):(.+)/, $$save{$1} = $2 foreach (split(/,/, $tag, 0));
return wantarray ? %$save : $save;
}
|
161
|
0 |
0 |
$$self{'make_hub'} ||= sub {
my $self = shift() if ref $_[0];
$$self{'hub_name'} ||= $$self{'host'};
$$self{'hub_name'} =~ s/:411$//;
}
|