summaryrefslogtreecommitdiff
path: root/Echolot
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2004-04-25 17:05:45 +0000
committerPeter Palfrader <peter@palfrader.org>2004-04-25 17:05:45 +0000
commit593244cf25930924ebee376597904bdb430d51ad (patch)
treed18a5b58e3c2d216c2713a5b4f08be69f35ca55b /Echolot
parent6295683edd4828724550c7bbcaf975b1c6acdd41 (diff)
Fix readwrite_gpg and add a few debug logs
Diffstat (limited to 'Echolot')
-rw-r--r--Echolot/Tools.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/Echolot/Tools.pm b/Echolot/Tools.pm
index 3c270a0..8af58fc 100644
--- a/Echolot/Tools.pm
+++ b/Echolot/Tools.pm
@@ -278,6 +278,9 @@ sub make_gpg_fds() {
sub readwrite_gpg($$$$$) {
my ($in, $inputfd, $stdoutfd, $stderrfd, $statusfd) = @_;
+
+ Echolot::Log::debug("Entering readwrite_gpg.");
+
local $INPUT_RECORD_SEPARATOR = undef;
my $sout = IO::Select->new();
my $sin = IO::Select->new();
@@ -296,7 +299,9 @@ sub readwrite_gpg($$$$$) {
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) {
$written = $wfd->syswrite($in, length($in) - $offset, $offset);
$offset += $written;
@@ -309,8 +314,9 @@ sub readwrite_gpg($$$$$) {
next unless (defined(@$readyr)); # Wait some more.
- for my $rfd (@$readyw) {
+ for my $rfd (@$readyr) {
if ($rfd->eof) {
+ Echolot::Log::debug("reading from $rfd done.");
$sout->remove($rfd);
close($rfd);
next;
@@ -329,6 +335,7 @@ sub readwrite_gpg($$$$$) {
}
}
}
+ Echolot::Log::debug("readwrite_gpg done.");
return ($stdout, $stderr, $status);
};