| 1 | ###################################################################### | ||||||||||||||||||||||||||||||
| 2 | # Description: Hylafax client that connects directly to the server # | ||||||||||||||||||||||||||||||
| 3 | # via Hylafax's proprietory FTP protocol # | ||||||||||||||||||||||||||||||
| 4 | # Author: Alex Rak (arak@cpan.org) # | ||||||||||||||||||||||||||||||
| 5 | # Copyright: See COPYRIGHT section in POD text below for usage and # | ||||||||||||||||||||||||||||||
| 6 | # distribution rights # | ||||||||||||||||||||||||||||||
| 7 | ###################################################################### | ||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||
| 9 | package Fax::Hylafax::Client; | ||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use 5.006; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | use Net::FTP; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 17 | 1 | require Exporter; | |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||
| 19 | 1 | our @ISA = qw(Exporter); | |||||||||||||||||||||||||||||
| 20 | 1 | our @EXPORT_OK = qw(faxinfo faxrm faxstat sendfax sendpage); | |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||
| 22 | 1 | our $VERSION = "1.02"; | |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||
| 24 | 1 | our $Host; | |||||||||||||||||||||||||||||
| 25 | 1 | our $Port; | |||||||||||||||||||||||||||||
| 26 | 1 | our $User; | |||||||||||||||||||||||||||||
| 27 | 1 | our $Password; | |||||||||||||||||||||||||||||
| 28 | 1 | our $Passive; | |||||||||||||||||||||||||||||
| 29 | 1 | our $Debug; | |||||||||||||||||||||||||||||
| 30 | 1 | our $NotifyAddr; | |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||
| 33 | sub faxinfo | ||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
faxinfo: not called CC=18 SCAR=58.3
Pod
documented
| |||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | shift if $_[0] eq __PACKAGE__; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | my %param = scalar @_ == 1 ? ('jobid', shift) : @_; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 37 | 0 | my $self = { | |||||||||||||||||||||||||||||
| 38 | TRACE => '', | ||||||||||||||||||||||||||||||
| 39 | SUCCESS => '', | ||||||||||||||||||||||||||||||
| 40 | CONTENT => '', | ||||||||||||||||||||||||||||||
| 41 | }; | ||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||
| 43 | ## Set defaults | ||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | $param{host} ||= $Host || 'localhost'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"host"} ||= $Fax::Hylafax::Client::Host || "localhost"
$Fax::Hylafax::Client::Host || 'localhost'
MC/DC0%0/2
$param{"host"} ||= $Fax::Hylafax::Client::Host || "localhost"
$param{"host"}
$Fax::Hylafax::Client::Host
Truth table0%0/3
A ||= B
A= $param{"host"}B= $Fax::Hylafax::Client::Host
| |||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | $param{port} ||= $Port || '4559'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"port"} ||= $Fax::Hylafax::Client::Port || 4559
$Fax::Hylafax::Client::Port || '4559'
MC/DC0%0/2
$param{"port"} ||= $Fax::Hylafax::Client::Port || 4559
$param{"port"}
$Fax::Hylafax::Client::Port
Truth table0%0/3
A ||= B
A= $param{"port"}B= $Fax::Hylafax::Client::Port
| |||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | $param{user} ||= $User || 'anonymous'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"user"} ||= $Fax::Hylafax::Client::User || "anonymous"
$Fax::Hylafax::Client::User || 'anonymous'
MC/DC0%0/2
$param{"user"} ||= $Fax::Hylafax::Client::User || "anonymous"
$param{"user"}
$Fax::Hylafax::Client::User
Truth table0%0/3
A ||= B
A= $param{"user"}B= $Fax::Hylafax::Client::User
| |||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | $param{password} ||= $Password || 'anonymous'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"password"} ||= $Fax::Hylafax::Client::Password || "anonymous"
$Fax::Hylafax::Client::Password || 'anonymous'
MC/DC0%0/2
$param{"password"} ||= $Fax::Hylafax::Client::Password || "anonymous"
$param{"password"}
$Fax::Hylafax::Client::Password
Truth table0%0/3
A ||= B
A= $param{"password"}B= $Fax::Hylafax::Client::Password
| |||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | $param{passive} ||= $Passive || '0'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"passive"} ||= $Fax::Hylafax::Client::Passive || 0
$Fax::Hylafax::Client::Passive || '0'
MC/DC0%0/2
$param{"passive"} ||= $Fax::Hylafax::Client::Passive || 0
$param{"passive"}
$Fax::Hylafax::Client::Passive
Truth table0%0/3
A ||= B
A= $param{"passive"}B= $Fax::Hylafax::Client::Passive
| |||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||
| 50 | ## Basic error checking | ||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | croak __PACKAGE__ . ": *jobid* parameter is missing" unless $param{jobid}; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||
| 53 | ## Try to connect | ||||||||||||||||||||||||||||||
| 54 | 0 | ▶ | my $client = Net::FTP->new($param{host}, Port => $param{port}, Passive => $param{passive}) || croak __PACKAGE__ . ": " . $@; | ||||||||||||||||||||||||||||
|
Condition0%0/2
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}) || croak('Fax::Hylafax::Client: ' . $@)
MC/DC0%0/1
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}) || croak('Fax::Hylafax::Client: ' . $@)
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'})
Truth table0%0/2
A
A= 'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'})
| |||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | $client->login($param{user}, $param{password}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 56 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||
| 58 | ## Process the task | ||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | $client->quot("job", $param{jobid}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 60 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | $client->quot("jparm state") || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 63 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 64 | 0 | $self->{CONTENT} = $client->message; | |||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||
| 66 | ## Disconnect | ||||||||||||||||||||||||||||||
| 67 | 0 | $client->quit; | |||||||||||||||||||||||||||||
| 68 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||
| 70 | 0 | return bless $self, __PACKAGE__ . "::Instant"; | |||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||
| 74 | sub faxrm | ||||||||||||||||||||||||||||||
| 75 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
faxrm: not called CC=19 SCAR=59.4
Pod
documented
| |||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | shift if $_[0] eq __PACKAGE__; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 77 | 0 | ▶ | my %param = scalar @_ == 1 ? ('jobid', shift) : @_; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 78 | 0 | my $self = { | |||||||||||||||||||||||||||||
| 79 | TRACE => '', | ||||||||||||||||||||||||||||||
| 80 | SUCCESS => '', | ||||||||||||||||||||||||||||||
| 81 | }; | ||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||
| 83 | ## Set defaults | ||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | $param{host} ||= $Host || 'localhost'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"host"} ||= $Fax::Hylafax::Client::Host || "localhost"
$Fax::Hylafax::Client::Host || 'localhost'
MC/DC0%0/2
$param{"host"} ||= $Fax::Hylafax::Client::Host || "localhost"
$param{"host"}
$Fax::Hylafax::Client::Host
Truth table0%0/3
A ||= B
A= $param{"host"}B= $Fax::Hylafax::Client::Host
| |||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | $param{port} ||= $Port || '4559'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"port"} ||= $Fax::Hylafax::Client::Port || 4559
$Fax::Hylafax::Client::Port || '4559'
MC/DC0%0/2
$param{"port"} ||= $Fax::Hylafax::Client::Port || 4559
$param{"port"}
$Fax::Hylafax::Client::Port
Truth table0%0/3
A ||= B
A= $param{"port"}B= $Fax::Hylafax::Client::Port
| |||||||||||||||||||||||||||||||
| 86 | 0 | ▶ | $param{user} ||= $User || 'anonymous'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"user"} ||= $Fax::Hylafax::Client::User || "anonymous"
$Fax::Hylafax::Client::User || 'anonymous'
MC/DC0%0/2
$param{"user"} ||= $Fax::Hylafax::Client::User || "anonymous"
$param{"user"}
$Fax::Hylafax::Client::User
Truth table0%0/3
A ||= B
A= $param{"user"}B= $Fax::Hylafax::Client::User
| |||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | $param{password} ||= $Password || 'anonymous'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"password"} ||= $Fax::Hylafax::Client::Password || "anonymous"
$Fax::Hylafax::Client::Password || 'anonymous'
MC/DC0%0/2
$param{"password"} ||= $Fax::Hylafax::Client::Password || "anonymous"
$param{"password"}
$Fax::Hylafax::Client::Password
Truth table0%0/3
A ||= B
A= $param{"password"}B= $Fax::Hylafax::Client::Password
| |||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | $param{passive} ||= $Passive || '0'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"passive"} ||= $Fax::Hylafax::Client::Passive || 0
$Fax::Hylafax::Client::Passive || '0'
MC/DC0%0/2
$param{"passive"} ||= $Fax::Hylafax::Client::Passive || 0
$param{"passive"}
$Fax::Hylafax::Client::Passive
Truth table0%0/3
A ||= B
A= $param{"passive"}B= $Fax::Hylafax::Client::Passive
| |||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||
| 90 | ## Basic error checking | ||||||||||||||||||||||||||||||
| 91 | 0 | ▶ | croak __PACKAGE__ . ": *jobid* parameter is missing" unless $param{jobid}; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||
| 93 | ## Try to connect | ||||||||||||||||||||||||||||||
| 94 | 0 | ▶ | my $client = Net::FTP->new($param{host}, Port => $param{port}, Passive => $param{passive}) || croak __PACKAGE__ . ": " . $@; | ||||||||||||||||||||||||||||
|
Condition0%0/2
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}) || croak('Fax::Hylafax::Client: ' . $@)
MC/DC0%0/1
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}) || croak('Fax::Hylafax::Client: ' . $@)
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'})
Truth table0%0/2
A
A= 'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'})
| |||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | $client->login($param{user}, $param{password}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 96 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||
| 98 | ## Process the task | ||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | $client->quot("jkill", $param{jobid}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 100 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 101 | 0 | ▶ | $self->{SUCCESS} = $client->message =~ /failed/i || $client->message =~ /cannot/i ? 0 : 1; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$client->message =~ /failed/i or $client->message =~ /cannot/i
MC/DC0%0/2
$client->message =~ /failed/i or $client->message =~ /cannot/i
$client->message =~ /failed/i
$client->message =~ /cannot/i
Truth table0%0/3
A or B
A= $client->message =~ /failed/iB= $client->message =~ /cannot/i
| |||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||
| 103 | ## Disconnect | ||||||||||||||||||||||||||||||
| 104 | 0 | $client->quit; | |||||||||||||||||||||||||||||
| 105 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||
| 107 | 0 | return bless $self, __PACKAGE__ . "::Instant"; | |||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||
| 111 | sub faxstat | ||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
faxstat: not called CC=47 SCAR=77.2
Pod
documented
| |||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | shift if $_[0] eq __PACKAGE__; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 114 | 0 | my %param = @_; | |||||||||||||||||||||||||||||
| 115 | 0 | my $self = { | |||||||||||||||||||||||||||||
| 116 | TRACE => '', | ||||||||||||||||||||||||||||||
| 117 | SUCCESS => '', | ||||||||||||||||||||||||||||||
| 118 | CONTENT => '', | ||||||||||||||||||||||||||||||
| 119 | }; | ||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||
| 121 | ## Set defaults | ||||||||||||||||||||||||||||||
| 122 | 0 | ▶ | $param{host} ||= $Host || 'localhost'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"host"} ||= $Fax::Hylafax::Client::Host || "localhost"
$Fax::Hylafax::Client::Host || 'localhost'
MC/DC0%0/2
$param{"host"} ||= $Fax::Hylafax::Client::Host || "localhost"
$param{"host"}
$Fax::Hylafax::Client::Host
Truth table0%0/3
A ||= B
A= $param{"host"}B= $Fax::Hylafax::Client::Host
| |||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | $param{port} ||= $Port || '4559'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"port"} ||= $Fax::Hylafax::Client::Port || 4559
$Fax::Hylafax::Client::Port || '4559'
MC/DC0%0/2
$param{"port"} ||= $Fax::Hylafax::Client::Port || 4559
$param{"port"}
$Fax::Hylafax::Client::Port
Truth table0%0/3
A ||= B
A= $param{"port"}B= $Fax::Hylafax::Client::Port
| |||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | $param{user} ||= $User || 'anonymous'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"user"} ||= $Fax::Hylafax::Client::User || "anonymous"
$Fax::Hylafax::Client::User || 'anonymous'
MC/DC0%0/2
$param{"user"} ||= $Fax::Hylafax::Client::User || "anonymous"
$param{"user"}
$Fax::Hylafax::Client::User
Truth table0%0/3
A ||= B
A= $param{"user"}B= $Fax::Hylafax::Client::User
| |||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | $param{password} ||= $Password || 'anonymous'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"password"} ||= $Fax::Hylafax::Client::Password || "anonymous"
$Fax::Hylafax::Client::Password || 'anonymous'
MC/DC0%0/2
$param{"password"} ||= $Fax::Hylafax::Client::Password || "anonymous"
$param{"password"}
$Fax::Hylafax::Client::Password
Truth table0%0/3
A ||= B
A= $param{"password"}B= $Fax::Hylafax::Client::Password
| |||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | $param{passive} ||= $Passive || '0'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"passive"} ||= $Fax::Hylafax::Client::Passive || 0
$Fax::Hylafax::Client::Passive || '0'
MC/DC0%0/2
$param{"passive"} ||= $Fax::Hylafax::Client::Passive || 0
$param{"passive"}
$Fax::Hylafax::Client::Passive
Truth table0%0/3
A ||= B
A= $param{"passive"}B= $Fax::Hylafax::Client::Passive
| |||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | $param{filefmt} ||= ''; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"filefmt"} ||= ""
MC/DC0%0/1
$param{"filefmt"} ||= ""
$param{"filefmt"}
Truth table0%0/2
A
A= $param{"filefmt"}
| |||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | $param{jobfmt} ||= '%-4j %3i %1a %6.6o %-12.12e %5P %5D %7z %.25s'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"jobfmt"} ||= "%-4j %3i %1a %6.6o %-12.12e %5P %5D %7z %.25s"
MC/DC0%0/1
$param{"jobfmt"} ||= "%-4j %3i %1a %6.6o %-12.12e %5P %5D %7z %.25s"
$param{"jobfmt"}
Truth table0%0/2
A
A= $param{"jobfmt"}
| |||||||||||||||||||||||||||||||
| 129 | 0 | ▶ | $param{rcvfmt} ||= '%-7m %4p%1z %-8.8o %14.14s %7t %f'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"rcvfmt"} ||= "%-7m %4p%1z %-8.8o %14.14s %7t %f"
MC/DC0%0/1
$param{"rcvfmt"} ||= "%-7m %4p%1z %-8.8o %14.14s %7t %f"
$param{"rcvfmt"}
Truth table0%0/2
A
A= $param{"rcvfmt"}
| |||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | $param{info} ||= '0'; # -i flag | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"info"} ||= 0
MC/DC0%0/1
$param{"info"} ||= 0
$param{"info"}
Truth table0%0/2
A
A= $param{"info"}
| |||||||||||||||||||||||||||||||
| 131 | 0 | ▶ | $param{files} ||= '0'; # -f flag | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"files"} ||= 0
MC/DC0%0/1
$param{"files"} ||= 0
$param{"files"}
Truth table0%0/2
A
A= $param{"files"}
| |||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | $param{queue} ||= '0'; # -s flag | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"queue"} ||= 0
MC/DC0%0/1
$param{"queue"} ||= 0
$param{"queue"}
Truth table0%0/2
A
A= $param{"queue"}
| |||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | $param{done} ||= '0'; # -d flag | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"done"} ||= 0
MC/DC0%0/1
$param{"done"} ||= 0
$param{"done"}
Truth table0%0/2
A
A= $param{"done"}
| |||||||||||||||||||||||||||||||
| 134 | 0 | ▶ | $param{received} ||= '0'; # -r flag | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"received"} ||= 0
MC/DC0%0/1
$param{"received"} ||= 0
$param{"received"}
Truth table0%0/2
A
A= $param{"received"}
| |||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||
| 136 | ## Try to connect | ||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | my $client = Net::FTP->new($param{host}, Port => $param{port}, Passive => $param{passive}) || croak __PACKAGE__ . ": " . $@; | ||||||||||||||||||||||||||||
|
Condition0%0/2
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}) || croak('Fax::Hylafax::Client: ' . $@)
MC/DC0%0/1
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}) || croak('Fax::Hylafax::Client: ' . $@)
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'})
Truth table0%0/2
A
A= 'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'})
| |||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | $client->login($param{user}, $param{password}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 139 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||
| 141 | ## Process the task | ||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | if ($param{info}) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 143 | { | ||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | my $dataconn = $client->retr("status/any.info") || _com_error($client); | ||||||||||||||||||||||||||||
|
Condition0%0/3
$client->retr('status/any.info') || _com_error($client)
MC/DC0%0/2
$client->retr('status/any.info') || _com_error($client)
$client->retr('status/any.info')
_com_error($client)
Truth table0%0/3
A || B
A= $client->retr('status/any.info')B= _com_error($client)
| |||||||||||||||||||||||||||||||
| 145 | 0 | ▶ | while ($dataconn->read(my $buffer, 1024)) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 146 | { | ||||||||||||||||||||||||||||||
| 147 | 0 | $self->{CONTENT} .= $buffer; | |||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||
| 149 | 0 | $dataconn->close; | |||||||||||||||||||||||||||||
| 150 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | my $dataconn = $client->list("status") || _com_error($client); | ||||||||||||||||||||||||||||
|
Condition0%0/3
$client->list('status') || _com_error($client)
MC/DC0%0/2
$client->list('status') || _com_error($client)
$client->list('status')
_com_error($client)
Truth table0%0/3
A || B
A= $client->list('status')B= _com_error($client)
| |||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | while ($dataconn->read(my $buffer, 1024)) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 155 | { | ||||||||||||||||||||||||||||||
| 156 | 0 | $self->{CONTENT} .= $buffer; | |||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||
| 158 | 0 | $dataconn->close; | |||||||||||||||||||||||||||||
| 159 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | if ($param{files}) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 162 | { | ||||||||||||||||||||||||||||||
| 163 | 0 | ▶ | $client->quot("filefmt", $param{filefmt}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 164 | 0 | ▶ | my $dataconn = $client->list("docq") || _com_error($client); | ||||||||||||||||||||||||||||
|
Condition0%0/3
$client->list('docq') || _com_error($client)
MC/DC0%0/2
$client->list('docq') || _com_error($client)
$client->list('docq')
_com_error($client)
Truth table0%0/3
A || B
A= $client->list('docq')B= _com_error($client)
| |||||||||||||||||||||||||||||||
| 165 | 0 | my $content; | |||||||||||||||||||||||||||||
| 166 | 0 | ▶ | while ($dataconn->read(my $buffer, 1024)) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 167 | { | ||||||||||||||||||||||||||||||
| 168 | 0 | $content .= $buffer; | |||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||
| 170 | 0 | $dataconn->close; | |||||||||||||||||||||||||||||
| 171 | 0 | ▶ | $self->{CONTENT} .= "\n$content" if $content; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 172 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | if ($param{queue}) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 176 | { | ||||||||||||||||||||||||||||||
| 177 | 0 | ▶ | $client->quot("jobfmt", $param{jobfmt}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | my $dataconn = $client->list("sendq") || _com_error($client); | ||||||||||||||||||||||||||||
|
Condition0%0/3
$client->list('sendq') || _com_error($client)
MC/DC0%0/2
$client->list('sendq') || _com_error($client)
$client->list('sendq')
_com_error($client)
Truth table0%0/3
A || B
A= $client->list('sendq')B= _com_error($client)
| |||||||||||||||||||||||||||||||
| 179 | 0 | my $content; | |||||||||||||||||||||||||||||
| 180 | 0 | ▶ | while ($dataconn->read(my $buffer, 1024)) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 181 | { | ||||||||||||||||||||||||||||||
| 182 | 0 | $content .= $buffer; | |||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||
| 184 | 0 | $dataconn->close; | |||||||||||||||||||||||||||||
| 185 | 0 | ▶ | $self->{CONTENT} .= "\n$content" if $content; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 186 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||
| 189 | 0 | ▶ | if ($param{done}) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 190 | { | ||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | $client->quot("jobfmt", $param{jobfmt}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 192 | 0 | ▶ | my $dataconn = $client->list("doneq") || _com_error($client); | ||||||||||||||||||||||||||||
|
Condition0%0/3
$client->list('doneq') || _com_error($client)
MC/DC0%0/2
$client->list('doneq') || _com_error($client)
$client->list('doneq')
_com_error($client)
Truth table0%0/3
A || B
A= $client->list('doneq')B= _com_error($client)
| |||||||||||||||||||||||||||||||
| 193 | 0 | my $content; | |||||||||||||||||||||||||||||
| 194 | 0 | ▶ | while ($dataconn->read(my $buffer, 1024)) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 195 | { | ||||||||||||||||||||||||||||||
| 196 | 0 | $content .= $buffer; | |||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||
| 198 | 0 | $dataconn->close; | |||||||||||||||||||||||||||||
| 199 | 0 | ▶ | $self->{CONTENT} .= "\n$content" if $content; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 200 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 201 | } | ||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||
| 203 | 0 | ▶ | if ($param{received}) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 204 | { | ||||||||||||||||||||||||||||||
| 205 | 0 | ▶ | $client->quot("rcvfmt", $param{rcvfmt}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 206 | 0 | ▶ | my $dataconn = $client->list("recvq") || _com_error($client); | ||||||||||||||||||||||||||||
|
Condition0%0/3
$client->list('recvq') || _com_error($client)
MC/DC0%0/2
$client->list('recvq') || _com_error($client)
$client->list('recvq')
_com_error($client)
Truth table0%0/3
A || B
A= $client->list('recvq')B= _com_error($client)
| |||||||||||||||||||||||||||||||
| 207 | 0 | my $content; | |||||||||||||||||||||||||||||
| 208 | 0 | ▶ | while ($dataconn->read(my $buffer, 1024)) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 209 | { | ||||||||||||||||||||||||||||||
| 210 | 0 | $content .= $buffer; | |||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||
| 212 | 0 | $dataconn->close; | |||||||||||||||||||||||||||||
| 213 | 0 | ▶ | $self->{CONTENT} .= "\n$content" if $content; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 214 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||
| 217 | ## Disconnect | ||||||||||||||||||||||||||||||
| 218 | 0 | $client->quit; | |||||||||||||||||||||||||||||
| 219 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||
| 221 | 0 | return bless $self, __PACKAGE__ . "::Instant"; | |||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||
| 225 | sub sendfax | ||||||||||||||||||||||||||||||
| 226 | 1 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
sendfax: called CC=70 SCAR=78.8
Pod
documented
| |||||||||||||||||||||||||||||||
| 227 | 1 | ▶ | shift if $_[0] eq __PACKAGE__; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 228 | 1 | my %param = @_; | |||||||||||||||||||||||||||||
| 229 | 1 | my $hostname = `hostname`; chomp $hostname; | |||||||||||||||||||||||||||||
| 230 | 1 | my $self = { | |||||||||||||||||||||||||||||
| 231 | JOB_ID => '', | ||||||||||||||||||||||||||||||
| 232 | TRACE => '', | ||||||||||||||||||||||||||||||
| 233 | SUCCESS => '', | ||||||||||||||||||||||||||||||
| 234 | }; | ||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||
| 236 | ## Set defaults | ||||||||||||||||||||||||||||||
| 237 | 1 | ▶ | $param{host} ||= $Host || 'localhost'; | ||||||||||||||||||||||||||||
|
Condition20%1/5
$param{"host"} ||= $Fax::Hylafax::Client::Host || "localhost"
$Fax::Hylafax::Client::Host || 'localhost'
MC/DC0%0/2
$param{"host"} ||= $Fax::Hylafax::Client::Host || "localhost"
$param{"host"}
$Fax::Hylafax::Client::Host
Truth table33%1/3
A ||= B
A= $param{"host"}B= $Fax::Hylafax::Client::Host
| |||||||||||||||||||||||||||||||
| 238 | 1 | ▶ | $param{port} ||= $Port || '4559'; | ||||||||||||||||||||||||||||
|
Condition40%2/5
$param{"port"} ||= $Fax::Hylafax::Client::Port || 4559
$Fax::Hylafax::Client::Port || '4559'
MC/DC0%0/2
$param{"port"} ||= $Fax::Hylafax::Client::Port || 4559
$param{"port"}
$Fax::Hylafax::Client::Port
Truth table0%0/3
A ||= B
A= $param{"port"}B= $Fax::Hylafax::Client::Port
| |||||||||||||||||||||||||||||||
| 239 | 1 | ▶ | $param{user} ||= $User || 'anonymous'; | ||||||||||||||||||||||||||||
|
Condition20%1/5
$param{"user"} ||= $Fax::Hylafax::Client::User || "anonymous"
$Fax::Hylafax::Client::User || 'anonymous'
MC/DC0%0/2
$param{"user"} ||= $Fax::Hylafax::Client::User || "anonymous"
$param{"user"}
$Fax::Hylafax::Client::User
Truth table33%1/3
A ||= B
A= $param{"user"}B= $Fax::Hylafax::Client::User
| |||||||||||||||||||||||||||||||
| 240 | 1 | ▶ | $param{password} ||= $Password || 'anonymous'; | ||||||||||||||||||||||||||||
|
Condition20%1/5
$param{"password"} ||= $Fax::Hylafax::Client::Password || "anonymous"
$Fax::Hylafax::Client::Password || 'anonymous'
MC/DC0%0/2
$param{"password"} ||= $Fax::Hylafax::Client::Password || "anonymous"
$param{"password"}
$Fax::Hylafax::Client::Password
Truth table33%1/3
A ||= B
A= $param{"password"}B= $Fax::Hylafax::Client::Password
| |||||||||||||||||||||||||||||||
| 241 | 1 | ▶ | $param{passive} ||= $Passive || '0'; | ||||||||||||||||||||||||||||
|
Condition40%2/5
$param{"passive"} ||= $Fax::Hylafax::Client::Passive || 0
$Fax::Hylafax::Client::Passive || '0'
MC/DC0%0/2
$param{"passive"} ||= $Fax::Hylafax::Client::Passive || 0
$param{"passive"}
$Fax::Hylafax::Client::Passive
Truth table33%1/3
A ||= B
A= $param{"passive"}B= $Fax::Hylafax::Client::Passive
| |||||||||||||||||||||||||||||||
| 242 | 1 | ▶ | $param{debug} ||= $Debug || '0'; | ||||||||||||||||||||||||||||
|
Condition40%2/5
$param{"debug"} ||= $Fax::Hylafax::Client::Debug || 0
$Fax::Hylafax::Client::Debug || '0'
MC/DC0%0/2
$param{"debug"} ||= $Fax::Hylafax::Client::Debug || 0
$param{"debug"}
$Fax::Hylafax::Client::Debug
Truth table33%1/3
A ||= B
A= $param{"debug"}B= $Fax::Hylafax::Client::Debug
| |||||||||||||||||||||||||||||||
| 243 | 1 | ▶ | $param{lasttime} ||= '000259'; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$param{"lasttime"} ||= "000259"
MC/DC0%0/1
$param{"lasttime"} ||= "000259"
$param{"lasttime"}
Truth table50%1/2
A
A= $param{"lasttime"}
| |||||||||||||||||||||||||||||||
| 244 | 1 | ▶ | $param{maxdials} ||= '12'; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$param{"maxdials"} ||= 12
MC/DC0%0/1
$param{"maxdials"} ||= 12
$param{"maxdials"}
Truth table50%1/2
A
A= $param{"maxdials"}
| |||||||||||||||||||||||||||||||
| 245 | 1 | ▶ | $param{maxtries} ||= '3'; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$param{"maxtries"} ||= 3
MC/DC0%0/1
$param{"maxtries"} ||= 3
$param{"maxtries"}
Truth table50%1/2
A
A= $param{"maxtries"}
| |||||||||||||||||||||||||||||||
| 246 | 1 | ▶ | $param{pagewidth} ||= '216'; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$param{"pagewidth"} ||= 216
MC/DC0%0/1
$param{"pagewidth"} ||= 216
$param{"pagewidth"}
Truth table50%1/2
A
A= $param{"pagewidth"}
| |||||||||||||||||||||||||||||||
| 247 | 1 | ▶ | $param{pagelength} ||= '279'; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$param{"pagelength"} ||= 279
MC/DC0%0/1
$param{"pagelength"} ||= 279
$param{"pagelength"}
Truth table50%1/2
A
A= $param{"pagelength"}
| |||||||||||||||||||||||||||||||
| 248 | 1 | ▶ | $param{vres} ||= '196'; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$param{"vres"} ||= 196
MC/DC0%0/1
$param{"vres"} ||= 196
$param{"vres"}
Truth table50%1/2
A
A= $param{"vres"}
| |||||||||||||||||||||||||||||||
| 249 | 1 | ▶ | $param{schedpri} ||= '127'; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$param{"schedpri"} ||= 127
MC/DC0%0/1
$param{"schedpri"} ||= 127
$param{"schedpri"}
Truth table50%1/2
A
A= $param{"schedpri"}
| |||||||||||||||||||||||||||||||
| 250 | 1 | ▶ | $param{chopthreshold} ||= '3'; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$param{"chopthreshold"} ||= 3
MC/DC0%0/1
$param{"chopthreshold"} ||= 3
$param{"chopthreshold"}
Truth table50%1/2
A
A= $param{"chopthreshold"}
| |||||||||||||||||||||||||||||||
| 251 | 1 | ▶ | $param{notify} ||= 'none'; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$param{"notify"} ||= "none"
MC/DC0%0/1
$param{"notify"} ||= "none"
$param{"notify"}
Truth table50%1/2
A
A= $param{"notify"}
| |||||||||||||||||||||||||||||||
| 252 | 1 | ▶ | $param{notifyaddr} ||= $NotifyAddr || $param{'user'} . '@' . $hostname; | ||||||||||||||||||||||||||||
|
Condition40%2/5
$param{"notifyaddr"} ||= $Fax::Hylafax::Client::NotifyAddr || $param{"user"} . '@' . $hostname
$Fax::Hylafax::Client::NotifyAddr || $param{'user'} . '@' . $hostname
MC/DC0%0/2
$param{"notifyaddr"} ||= $Fax::Hylafax::Client::NotifyAddr || $param{"user"} . '@' . $hostname
$param{"notifyaddr"}
$Fax::Hylafax::Client::NotifyAddr
Truth table0%0/3
A ||= B
A= $param{"notifyaddr"}B= $Fax::Hylafax::Client::NotifyAddr
| |||||||||||||||||||||||||||||||
| 253 | 1 | ▶ | $param{sendtime} ||= 'now'; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$param{"sendtime"} ||= "now"
MC/DC0%0/1
$param{"sendtime"} ||= "now"
$param{"sendtime"}
Truth table50%1/2
A
A= $param{"sendtime"}
| |||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||
| 255 | 1 | $self->{PARAM} = \%param; | |||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||
| 257 | ## Basic error checking | ||||||||||||||||||||||||||||||
| 258 | 1 | ▶ | croak __PACKAGE__ . ": *dialstring* parameter is missing" unless $param{dialstring}; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 259 | 0 | ▶ | croak __PACKAGE__ . ": *docfile* parameter is missing" if (! $param{docfile} && ! $param{poll}); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$param{"docfile"} or $param{"poll"}
MC/DC0%0/2
$param{"docfile"} or $param{"poll"}
$param{"docfile"}
$param{"poll"}
Truth table0%0/3
A or B
A= $param{"docfile"}B= $param{"poll"}
| |||||||||||||||||||||||||||||||
| 260 | 0 | ▶ | croak __PACKAGE__ . ": $param{coverfile} does not exist" if ($param{coverfile} && ! -e $param{coverfile}); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$param{"coverfile"} and not -e $param{"coverfile"}
MC/DC0%0/2
$param{"coverfile"} and not -e $param{"coverfile"}
$param{"coverfile"}
not -e $param{"coverfile"}
Truth table0%0/3
A and not(B)
A= $param{"coverfile"}B= not -e $param{"coverfile"}
| |||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||
| 262 | 0 | ▶ | if (ref(\$param{docfile}) eq 'SCALAR') | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 263 | { | ||||||||||||||||||||||||||||||
| 264 | 0 | $param{docfiles} = [ $param{docfile} ]; | |||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||
| 266 | elsif (ref($param{docfile}) eq 'ARRAY') | ||||||||||||||||||||||||||||||
| 267 | { | ||||||||||||||||||||||||||||||
| 268 | 0 | $param{docfiles} = $param{docfile}; | |||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||
| 270 | else | ||||||||||||||||||||||||||||||
| 271 | { | ||||||||||||||||||||||||||||||
| 272 | 0 | croak __PACKAGE__ . ": *docfile* parameter must be a SCALAR or an ARRAY REFERENCE"; | |||||||||||||||||||||||||||||
| 273 | } | ||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||
| 275 | 0 | foreach my $docfile (@{$param{docfiles}}) | |||||||||||||||||||||||||||||
| 276 | { | ||||||||||||||||||||||||||||||
| 277 | 0 | ▶ | croak __PACKAGE__ . ": $docfile does not exist" if (! -e $docfile); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||
| 280 | 0 | delete $param{docfile}; | |||||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||||
| 282 | ## Try to connect | ||||||||||||||||||||||||||||||
| 283 | 0 | ▶ | my $client = Net::FTP->new($param{'host'}, Port => $param{'port'}, Passive => $param{'passive'}, Debug => $param{'debug'}) || croak __PACKAGE__ . ": " . $@; | ||||||||||||||||||||||||||||
|
Condition0%0/2
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}, 'Debug', $param{'debug'}) || croak('Fax::Hylafax::Client: ' . $@)
MC/DC0%0/1
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}, 'Debug', $param{'debug'}) || croak('Fax::Hylafax::Client: ' . $@)
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}, 'Debug', $param{'debug'})
Truth table0%0/2
A
A= 'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}, 'Debug', $param{'debug'})
| |||||||||||||||||||||||||||||||
| 284 | 0 | ▶ | $client->login($param{'user'}, $param{'password'}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 285 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 286 | 0 | ▶ | $client->binary || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 287 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||
| 289 | ## Process the job | ||||||||||||||||||||||||||||||
| 290 | 0 | my @tempfiles = (); | |||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||||
| 292 | 0 | ▶ | if ($param{coverfile}) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 293 | { | ||||||||||||||||||||||||||||||
| 294 | 0 | my $unique = time . sprintf('%05d', $$) . sprintf('%04d', int(rand 10000)); | |||||||||||||||||||||||||||||
| 295 | 0 | my $remote = '/tmp/cover.' . $hostname . '.' . $unique; | |||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||
| 297 | 0 | ▶ | $client->put($param{coverfile}, $remote) || _com_error($client); # (STOT would be nice, but Net::FTP doesn`t support it and STOU is broken) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 298 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||
| 300 | 0 | push (@tempfiles, $remote); | |||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||||
| 303 | 0 | foreach my $docfile (@{$param{docfiles}}) | |||||||||||||||||||||||||||||
| 304 | { | ||||||||||||||||||||||||||||||
| 305 | 0 | my $unique = time . sprintf('%05d', $$) . sprintf('%04d', int(rand 10000)); | |||||||||||||||||||||||||||||
| 306 | 0 | my $remote = '/tmp/doc.' . $hostname . '.' . $unique; | |||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||
| 308 | 0 | ▶ | $client->put($docfile, $remote) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 309 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||
| 311 | 0 | push (@tempfiles, $remote); | |||||||||||||||||||||||||||||
| 312 | } | ||||||||||||||||||||||||||||||
| 313 | |||||||||||||||||||||||||||||||
| 314 | 0 | ▶ | $client->quot("jnew") || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 315 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 316 | 0 | $client->message =~ /jobid: (\d+)/i; | |||||||||||||||||||||||||||||
| 317 | 0 | ▶ | $self->{JOB_ID} = $1 if $1; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 318 | 0 | $self->{PARAM}->{jobid} = $self->{JOB_ID}; | |||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||
| 320 | 0 | ▶ | $client->quot("jparm fromuser", $param{'user'}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 321 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||
| 323 | 0 | ▶ | $client->quot("jparm lasttime", $param{lasttime}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 324 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||
| 326 | 0 | ▶ | $client->quot("jparm maxdials", $param{maxdials}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 327 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||
| 329 | 0 | ▶ | $client->quot("jparm maxtries", $param{maxtries}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 330 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||
| 332 | 0 | ▶ | $client->quot("jparm schedpri", $param{schedpri}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 333 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||
| 335 | 0 | ▶ | $client->quot("jparm dialstring", $param{dialstring}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 336 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | $client->quot("jparm sendtime", $param{sendtime}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 339 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||||
| 341 | 0 | ▶ | $client->quot("jparm notifyaddr", $param{notifyaddr}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 342 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||
| 344 | 0 | ▶ | $client->quot("jparm vres", $param{vres}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 345 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||
| 347 | 0 | ▶ | $client->quot("jparm pagewidth", $param{pagewidth}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 348 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||
| 350 | 0 | ▶ | $client->quot("jparm pagelength", $param{pagelength}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 351 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 352 | |||||||||||||||||||||||||||||||
| 353 | 0 | ▶ | $client->quot("jparm notify", $param{notify}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 354 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||||
| 356 | 0 | ▶ | $client->quot("jparm pagechop", "default") || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 357 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||
| 359 | 0 | ▶ | $client->quot("jparm chopthreshold", $param{chopthreshold}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 360 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 361 | |||||||||||||||||||||||||||||||
| 362 | 0 | foreach my $docfile (@tempfiles) | |||||||||||||||||||||||||||||
| 363 | { | ||||||||||||||||||||||||||||||
| 364 | 0 | ▶ | if ($param{coverfile} && $docfile eq $tempfiles[0]) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$param{"coverfile"} and $docfile eq $tempfiles[0]
MC/DC0%0/2
$param{"coverfile"} and $docfile eq $tempfiles[0]
$param{"coverfile"}
$docfile eq $tempfiles[0]
Truth table0%0/3
A and B
A= $param{"coverfile"}B= $docfile eq $tempfiles[0]
| |||||||||||||||||||||||||||||||
| 365 | { | ||||||||||||||||||||||||||||||
| 366 | 0 | ▶ | $client->quot("jparm cover", $docfile) or _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 367 | } | ||||||||||||||||||||||||||||||
| 368 | else | ||||||||||||||||||||||||||||||
| 369 | { | ||||||||||||||||||||||||||||||
| 370 | 0 | ▶ | $client->quot("jparm document", $docfile) or _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 371 | } | ||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||
| 373 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 374 | } | ||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||
| 376 | 0 | ▶ | if (defined $param{poll}) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 377 | { | ||||||||||||||||||||||||||||||
| 378 | 0 | my ($selector, $passwd) = split(" ", $param{poll}); | |||||||||||||||||||||||||||||
| 379 | 0 | ▶ | $client->quot("jparm poll", $selector || "", $passwd || "") || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/4
$selector || ''
$passwd || ''
MC/DC0%0/1
$selector || ''
$selector
MC/DC0%0/1
$passwd || ''
$passwd
Truth table0%0/2
A
A= $selector
Truth table0%0/2
A
A= $passwd
| |||||||||||||||||||||||||||||||
| 380 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 381 | } | ||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||
| 383 | 0 | ▶ | $client->quot("jsubm") || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 384 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 385 | 0 | ▶ | $self->{SUCCESS} = $client->message =~ /failed/i || $client->message =~ /failed/i? 0 : 1; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$client->message =~ /failed/i or $client->message =~ /failed/i
MC/DC0%0/2
$client->message =~ /failed/i or $client->message =~ /failed/i
$client->message =~ /failed/i
$client->message =~ /failed/i
Truth table0%0/3
A or B
A= $client->message =~ /failed/iB= $client->message =~ /failed/i
| |||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||
| 387 | ## Disconnect | ||||||||||||||||||||||||||||||
| 388 | 0 | $client->quit; | |||||||||||||||||||||||||||||
| 389 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 390 | |||||||||||||||||||||||||||||||
| 391 | 0 | return bless $self, __PACKAGE__ . "::Queued"; | |||||||||||||||||||||||||||||
| 392 | } | ||||||||||||||||||||||||||||||
| 393 | |||||||||||||||||||||||||||||||
| 394 | |||||||||||||||||||||||||||||||
| 395 | sub sendpage | ||||||||||||||||||||||||||||||
| 396 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
sendpage: not called CC=35 SCAR=71.4
Pod
documented
| |||||||||||||||||||||||||||||||
| 397 | 0 | ▶ | shift if $_[0] eq __PACKAGE__; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 398 | 0 | my %param = @_; | |||||||||||||||||||||||||||||
| 399 | 0 | my $hostname = `hostname`; chomp $hostname; | |||||||||||||||||||||||||||||
| 400 | 0 | my $unique = time . $$ . int(rand 10000); | |||||||||||||||||||||||||||||
| 401 | 0 | my $self = { | |||||||||||||||||||||||||||||
| 402 | JOB_ID => '', | ||||||||||||||||||||||||||||||
| 403 | TRACE => '', | ||||||||||||||||||||||||||||||
| 404 | SUCCESS => '', | ||||||||||||||||||||||||||||||
| 405 | }; | ||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||
| 407 | ## Set defaults | ||||||||||||||||||||||||||||||
| 408 | 0 | ▶ | $param{host} ||= $Host || 'localhost'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"host"} ||= $Fax::Hylafax::Client::Host || "localhost"
$Fax::Hylafax::Client::Host || 'localhost'
MC/DC0%0/2
$param{"host"} ||= $Fax::Hylafax::Client::Host || "localhost"
$param{"host"}
$Fax::Hylafax::Client::Host
Truth table0%0/3
A ||= B
A= $param{"host"}B= $Fax::Hylafax::Client::Host
| |||||||||||||||||||||||||||||||
| 409 | 0 | ▶ | $param{port} ||= $Port || '444'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"port"} ||= $Fax::Hylafax::Client::Port || 444
$Fax::Hylafax::Client::Port || '444'
MC/DC0%0/2
$param{"port"} ||= $Fax::Hylafax::Client::Port || 444
$param{"port"}
$Fax::Hylafax::Client::Port
Truth table0%0/3
A ||= B
A= $param{"port"}B= $Fax::Hylafax::Client::Port
| |||||||||||||||||||||||||||||||
| 410 | 0 | ▶ | $param{user} ||= $User || 'anonymous'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"user"} ||= $Fax::Hylafax::Client::User || "anonymous"
$Fax::Hylafax::Client::User || 'anonymous'
MC/DC0%0/2
$param{"user"} ||= $Fax::Hylafax::Client::User || "anonymous"
$param{"user"}
$Fax::Hylafax::Client::User
Truth table0%0/3
A ||= B
A= $param{"user"}B= $Fax::Hylafax::Client::User
| |||||||||||||||||||||||||||||||
| 411 | 0 | ▶ | $param{password} ||= $Password || 'anonymous'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"password"} ||= $Fax::Hylafax::Client::Password || "anonymous"
$Fax::Hylafax::Client::Password || 'anonymous'
MC/DC0%0/2
$param{"password"} ||= $Fax::Hylafax::Client::Password || "anonymous"
$param{"password"}
$Fax::Hylafax::Client::Password
Truth table0%0/3
A ||= B
A= $param{"password"}B= $Fax::Hylafax::Client::Password
| |||||||||||||||||||||||||||||||
| 412 | 0 | ▶ | $param{passive} ||= $Passive || '0'; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"passive"} ||= $Fax::Hylafax::Client::Passive || 0
$Fax::Hylafax::Client::Passive || '0'
MC/DC0%0/2
$param{"passive"} ||= $Fax::Hylafax::Client::Passive || 0
$param{"passive"}
$Fax::Hylafax::Client::Passive
Truth table0%0/3
A ||= B
A= $param{"passive"}B= $Fax::Hylafax::Client::Passive
| |||||||||||||||||||||||||||||||
| 413 | 0 | ▶ | $param{maxdials} ||= '12'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"maxdials"} ||= 12
MC/DC0%0/1
$param{"maxdials"} ||= 12
$param{"maxdials"}
Truth table0%0/2
A
A= $param{"maxdials"}
| |||||||||||||||||||||||||||||||
| 414 | 0 | ▶ | $param{maxtries} ||= '3'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"maxtries"} ||= 3
MC/DC0%0/1
$param{"maxtries"} ||= 3
$param{"maxtries"}
Truth table0%0/2
A
A= $param{"maxtries"}
| |||||||||||||||||||||||||||||||
| 415 | 0 | ▶ | $param{notify} ||= 'none'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"notify"} ||= "none"
MC/DC0%0/1
$param{"notify"} ||= "none"
$param{"notify"}
Truth table0%0/2
A
A= $param{"notify"}
| |||||||||||||||||||||||||||||||
| 416 | 0 | ▶ | $param{notifyaddr} ||= $NotifyAddr || $param{'user'} . '@' . $hostname; | ||||||||||||||||||||||||||||
|
Condition0%0/5
$param{"notifyaddr"} ||= $Fax::Hylafax::Client::NotifyAddr || $param{"user"} . '@' . $hostname
$Fax::Hylafax::Client::NotifyAddr || $param{'user'} . '@' . $hostname
MC/DC0%0/2
$param{"notifyaddr"} ||= $Fax::Hylafax::Client::NotifyAddr || $param{"user"} . '@' . $hostname
$param{"notifyaddr"}
$Fax::Hylafax::Client::NotifyAddr
Truth table0%0/3
A ||= B
A= $param{"notifyaddr"}B= $Fax::Hylafax::Client::NotifyAddr
| |||||||||||||||||||||||||||||||
| 417 | 0 | ▶ | $param{level} ||= '1'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$param{"level"} ||= 1
MC/DC0%0/1
$param{"level"} ||= 1
$param{"level"}
Truth table0%0/2
A
A= $param{"level"}
| |||||||||||||||||||||||||||||||
| 418 | |||||||||||||||||||||||||||||||
| 419 | 0 | $self->{PARAM} = \%param; | |||||||||||||||||||||||||||||
| 420 | |||||||||||||||||||||||||||||||
| 421 | ## Basic error checking | ||||||||||||||||||||||||||||||
| 422 | 0 | ▶ | croak __PACKAGE__ . ": *pin* parameter is missing" unless $param{pin}; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 423 | |||||||||||||||||||||||||||||||
| 424 | ## Try to connect | ||||||||||||||||||||||||||||||
| 425 | 0 | ▶ | my $client = Net::FTP->new($param{'host'}, Port => $param{'port'}, Passive => $param{'passive'}) || croak __PACKAGE__ . ": " . $@; | ||||||||||||||||||||||||||||
|
Condition0%0/2
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}) || croak('Fax::Hylafax::Client: ' . $@)
MC/DC0%0/1
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'}) || croak('Fax::Hylafax::Client: ' . $@)
'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'})
Truth table0%0/2
A
A= 'Net::FTP'->new($param{'host'}, 'Port', $param{'port'}, 'Passive', $param{'passive'})
| |||||||||||||||||||||||||||||||
| 426 | 0 | ▶ | $client->quot("logi", $param{user}, $param{password}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 427 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 428 | |||||||||||||||||||||||||||||||
| 429 | ## Process the job | ||||||||||||||||||||||||||||||
| 430 | 0 | ▶ | $client->quot("site help", "notify") || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 431 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 432 | |||||||||||||||||||||||||||||||
| 433 | 0 | ▶ | $client->quot("leve", $param{level}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 434 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 435 | |||||||||||||||||||||||||||||||
| 436 | 0 | ▶ | $client->quot("site fromuser", $param{'user'}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 437 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 438 | |||||||||||||||||||||||||||||||
| 439 | 0 | ▶ | $client->quot("site maxdials", $param{maxdials}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 440 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 441 | |||||||||||||||||||||||||||||||
| 442 | 0 | ▶ | $client->quot("site maxtries", $param{maxtries}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 443 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||||
| 445 | 0 | ▶ | $client->quot("site mailaddr", $param{notifyaddr}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 446 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 447 | |||||||||||||||||||||||||||||||
| 448 | 0 | ▶ | $client->quot("site notify", $param{notify}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 449 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||||
| 451 | 0 | ▶ | $client->quot("site jqueue", "yes") || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 452 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 453 | |||||||||||||||||||||||||||||||
| 454 | 0 | ▶ | $client->quot("page", $param{pin}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 455 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 456 | 0 | $client->message =~ /jobid: (\d+)\./i; | |||||||||||||||||||||||||||||
| 457 | 0 | ▶ | $self->{JOB_ID} = $1 if $1; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 458 | 0 | $self->{PARAM}->{jobid} = $self->{JOB_ID}; | |||||||||||||||||||||||||||||
| 459 | |||||||||||||||||||||||||||||||
| 460 | 0 | ▶ | if ($param{message}) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 461 | { | ||||||||||||||||||||||||||||||
| 462 | 0 | ▶ | $client->quot("mess", $param{message}) || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 463 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 464 | } | ||||||||||||||||||||||||||||||
| 465 | |||||||||||||||||||||||||||||||
| 466 | 0 | ▶ | $client->quot("send") || _com_error($client); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 467 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 468 | 0 | ▶ | $self->{SUCCESS} = $client->message =~ /success/i ? 1 : 0; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 469 | |||||||||||||||||||||||||||||||
| 470 | ## Disconnect | ||||||||||||||||||||||||||||||
| 471 | 0 | $client->quit; | |||||||||||||||||||||||||||||
| 472 | 0 | $self->{TRACE} .= $client->message; | |||||||||||||||||||||||||||||
| 473 | |||||||||||||||||||||||||||||||
| 474 | 0 | return bless $self, __PACKAGE__ . "::Queued"; | |||||||||||||||||||||||||||||
| 475 | } | ||||||||||||||||||||||||||||||
| 476 | |||||||||||||||||||||||||||||||
| 477 | ###################################################################### | ||||||||||||||||||||||||||||||
| 478 | |||||||||||||||||||||||||||||||
| 479 | sub _com_error | ||||||||||||||||||||||||||||||
| 480 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
_com_error: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||
| 481 | 0 | my $client = shift; | |||||||||||||||||||||||||||||
| 482 | 0 | croak __PACKAGE__ . ": Communication error: " . $client->message; | |||||||||||||||||||||||||||||
| 483 | } | ||||||||||||||||||||||||||||||
| 484 | |||||||||||||||||||||||||||||||
| 485 | |||||||||||||||||||||||||||||||
| 486 | sub _content | ||||||||||||||||||||||||||||||
| 487 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
_content: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||
| 488 | 0 | my $class = shift; | |||||||||||||||||||||||||||||
| 489 | 0 | my $self = shift; | |||||||||||||||||||||||||||||
| 490 | 0 | ▶ | return $self->{CONTENT} || undef; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{'CONTENT'} || undef
MC/DC0%0/1
$self->{'CONTENT'} || undef
$self->{'CONTENT'}
Truth table0%0/2
A
A= $self->{'CONTENT'}
| |||||||||||||||||||||||||||||||
| 491 | } | ||||||||||||||||||||||||||||||
| 492 | |||||||||||||||||||||||||||||||
| 493 | |||||||||||||||||||||||||||||||
| 494 | sub _success | ||||||||||||||||||||||||||||||
| 495 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
_success: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||
| 496 | 0 | my $class = shift; | |||||||||||||||||||||||||||||
| 497 | 0 | my $self = shift; | |||||||||||||||||||||||||||||
| 498 | 0 | ▶ | return $self->{SUCCESS} || undef; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{'SUCCESS'} || undef
MC/DC0%0/1
$self->{'SUCCESS'} || undef
$self->{'SUCCESS'}
Truth table0%0/2
A
A= $self->{'SUCCESS'}
| |||||||||||||||||||||||||||||||
| 499 | } | ||||||||||||||||||||||||||||||
| 500 | |||||||||||||||||||||||||||||||
| 501 | |||||||||||||||||||||||||||||||
| 502 | sub _trace | ||||||||||||||||||||||||||||||
| 503 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
_trace: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||
| 504 | 0 | my $class = shift; | |||||||||||||||||||||||||||||
| 505 | 0 | my $self = shift; | |||||||||||||||||||||||||||||
| 506 | 0 | ▶ | return $self->{TRACE} || undef; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{'TRACE'} || undef
MC/DC0%0/1
$self->{'TRACE'} || undef
$self->{'TRACE'}
Truth table0%0/2
A
A= $self->{'TRACE'}
| |||||||||||||||||||||||||||||||
| 507 | } | ||||||||||||||||||||||||||||||
| 508 | |||||||||||||||||||||||||||||||
| 509 | ###################################################################### | ||||||||||||||||||||||||||||||
| 510 | |||||||||||||||||||||||||||||||
| 511 | package Fax::Hylafax::Client::Queued; | ||||||||||||||||||||||||||||||
| 512 | |||||||||||||||||||||||||||||||
| 513 | |||||||||||||||||||||||||||||||
| 514 | sub faxinfo | ||||||||||||||||||||||||||||||
| 515 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
faxinfo: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||
| 516 | 0 | my $self = shift; | |||||||||||||||||||||||||||||
| 517 | 0 | my $conn = Fax::Hylafax::Client->faxinfo(%{$self->{PARAM}}); | |||||||||||||||||||||||||||||
| 518 | 0 | $self->{TRACE} = $conn->trace; | |||||||||||||||||||||||||||||
| 519 | 0 | $self->{SUCCESS} = $conn->success; | |||||||||||||||||||||||||||||
| 520 | 0 | return $conn->content; | |||||||||||||||||||||||||||||
| 521 | } | ||||||||||||||||||||||||||||||
| 522 | |||||||||||||||||||||||||||||||
| 523 | |||||||||||||||||||||||||||||||
| 524 | sub faxrm | ||||||||||||||||||||||||||||||
| 525 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
faxrm: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||
| 526 | 0 | my $self = shift; | |||||||||||||||||||||||||||||
| 527 | 0 | my $conn = Fax::Hylafax::Client->faxrm(%{$self->{PARAM}}); | |||||||||||||||||||||||||||||
| 528 | 0 | $self->{TRACE} = $conn->trace; | |||||||||||||||||||||||||||||
| 529 | 0 | $self->{SUCCESS} = $conn->success; | |||||||||||||||||||||||||||||
| 530 | 0 | return $conn->success; | |||||||||||||||||||||||||||||
| 531 | } | ||||||||||||||||||||||||||||||
| 532 | |||||||||||||||||||||||||||||||
| 533 | |||||||||||||||||||||||||||||||
| 534 | sub jobid | ||||||||||||||||||||||||||||||
| 535 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
jobid: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||
| 536 | 0 | my $self = shift; | |||||||||||||||||||||||||||||
| 537 | 0 | return $self->{JOB_ID}; | |||||||||||||||||||||||||||||
| 538 | } | ||||||||||||||||||||||||||||||
| 539 | |||||||||||||||||||||||||||||||
| 540 | |||||||||||||||||||||||||||||||
| 541 | sub success | ||||||||||||||||||||||||||||||
| 542 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
success: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||
| 543 | 0 | return Fax::Hylafax::Client->_success(shift); | |||||||||||||||||||||||||||||
| 544 | } | ||||||||||||||||||||||||||||||
| 545 | |||||||||||||||||||||||||||||||
| 546 | |||||||||||||||||||||||||||||||
| 547 | sub trace | ||||||||||||||||||||||||||||||
| 548 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
trace: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||
| 549 | 0 | return Fax::Hylafax::Client->_trace(shift); | |||||||||||||||||||||||||||||
| 550 | } | ||||||||||||||||||||||||||||||
| 551 | |||||||||||||||||||||||||||||||
| 552 | ###################################################################### | ||||||||||||||||||||||||||||||
| 553 | |||||||||||||||||||||||||||||||
| 554 | package Fax::Hylafax::Client::Instant; | ||||||||||||||||||||||||||||||
| 555 | |||||||||||||||||||||||||||||||
| 556 | |||||||||||||||||||||||||||||||
| 557 | sub content | ||||||||||||||||||||||||||||||
| 558 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
content: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||
| 559 | 0 | return Fax::Hylafax::Client->_content(shift); | |||||||||||||||||||||||||||||
| 560 | } | ||||||||||||||||||||||||||||||
| 561 | |||||||||||||||||||||||||||||||
| 562 | |||||||||||||||||||||||||||||||
| 563 | sub success | ||||||||||||||||||||||||||||||
| 564 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
success: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||
| 565 | 0 | return Fax::Hylafax::Client->_success(shift); | |||||||||||||||||||||||||||||
| 566 | } | ||||||||||||||||||||||||||||||
| 567 | |||||||||||||||||||||||||||||||
| 568 | |||||||||||||||||||||||||||||||
| 569 | sub trace | ||||||||||||||||||||||||||||||
| 570 | 0 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
trace: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||
| 571 | 0 | return Fax::Hylafax::Client->_trace(shift); | |||||||||||||||||||||||||||||
| 572 | } | ||||||||||||||||||||||||||||||
| 573 | |||||||||||||||||||||||||||||||
| 574 | ###################################################################### | ||||||||||||||||||||||||||||||
| 575 | |||||||||||||||||||||||||||||||
| 576 | 1 | 1; | |||||||||||||||||||||||||||||
| 577 | |||||||||||||||||||||||||||||||
| 578 | __END__ | ||||||||||||||||||||||||||||||