| 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 | package Net::Async::Tangence::Client::via::sshexec 0.16; | ||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use v5.14; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | sub connect | ||||||||||||||||||||||||||||
| 12 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
connect: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | 0 | my $client = shift; | |||||||||||||||||||||||||||
| 14 | 0 | my ( $uri, %args ) = @_; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 0 | my @sshargs; | |||||||||||||||||||||||||||
| 17 | 0 | ▶ | push @sshargs, "-4" if $args{family} and $args{family} eq "inet4"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$args{"family"} and $args{"family"} eq "inet4"
MC/DC0%0/2
$args{"family"} and $args{"family"} eq "inet4"
$args{"family"}
$args{"family"} eq "inet4"
Truth table0%0/3
A and B
A= $args{"family"}B= $args{"family"} eq "inet4"
| |||||||||||||||||||||||||||||
| 18 | 0 | ▶ | push @sshargs, "-6" if $args{family} and $args{family} eq "inet6"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$args{"family"} and $args{"family"} eq "inet6"
MC/DC0%0/2
$args{"family"} and $args{"family"} eq "inet6"
$args{"family"}
$args{"family"} eq "inet6"
Truth table0%0/3
A and B
A= $args{"family"}B= $args{"family"} eq "inet6"
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | my $host = $uri->authority; | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | my $path = $uri->path; | |||||||||||||||||||||||||||
| 23 | # Path will start with a leading /; we need to trim that | ||||||||||||||||||||||||||||
| 24 | 0 | $path =~ s{^/}{}; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | my $query = $uri->query; | |||||||||||||||||||||||||||
| 27 | 0 | ▶ | defined $query or $query = ""; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | # $query will contain args to exec - split them on + | ||||||||||||||||||||||||||||
| 29 | 0 | my @argv = split( m/\+/, $query ); | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 0 | return $client->connect_exec( [ "ssh", @sshargs, $host, $path, @argv ] ); | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 1 | 0x55AA; | |||||||||||||||||||||||||||