summaryrefslogtreecommitdiff
path: root/Echolot
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2004-04-25 17:25:54 +0000
committerPeter Palfrader <peter@palfrader.org>2004-04-25 17:25:54 +0000
commitcf61926ae6dfba69045a50776d402ebb37c71e93 (patch)
treedfd7bf389d60d52b6cbd339eb5d9d05959cb1d3d /Echolot
parenta01d76821f7d1c0d7e3c8aa6cc7f97105722f4fc (diff)
Better debug logging. I should really introduce a TRACE level
Diffstat (limited to 'Echolot')
-rw-r--r--Echolot/Tools.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Echolot/Tools.pm b/Echolot/Tools.pm
index 8af58fc..46b7f3e 100644
--- a/Echolot/Tools.pm
+++ b/Echolot/Tools.pm
@@ -295,17 +295,21 @@ sub readwrite_gpg($$$$$) {
$sout->add($statusfd);
$sin->add($inputfd);
+ Echolot::Log::debug("input is $inputfd; output is $stdoutfd; err is $stderrfd; status is $statusfd.");
+
my ($stdout, $stderr, $status) = ("", "", "");
my ($readyr, $readyw, $written);
while ($sout->count() > 0) {
Echolot::Log::debug("select waiting for ".($sout->count())." fds.");
($readyr, $readyw, undef) = IO::Select::select($sout, $sin, undef, 42);
- Echolot::Log::debug("ready: write: ".(scalar @$readyw)."; read: ".(scalar @$readyw));
- foreach my $wfd (@$readyw) {
+ Echolot::Log::debug("ready: write: ".(scalar @$readyw)."; read: ".(scalar @$readyr));
+ for my $wfd (@$readyw) {
+ Echolot::Log::debug("writing to $wfd.");
$written = $wfd->syswrite($in, length($in) - $offset, $offset);
$offset += $written;
if ($offset == length($in)) {
+ Echolot::Log::debug("writing to $wfd done.");
close $wfd;
$sin->remove($wfd);
$sin = undef;
@@ -321,6 +325,7 @@ sub readwrite_gpg($$$$$) {
close($rfd);
next;
}
+ Echolot::Log::debug("reading from $rfd.");
if ($rfd == $stdoutfd) {
$stdout .= <$rfd>;
next;