summaryrefslogtreecommitdiff
path: root/Echolot/Pinger
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2004-04-26 13:23:28 +0000
committerPeter Palfrader <peter@palfrader.org>2004-04-26 13:23:28 +0000
commit902c858f19a42d39a88547767fe0d19af4e84770 (patch)
tree568abc72f99078f5eccb9290c6369e20e75ab295 /Echolot/Pinger
parentcf61926ae6dfba69045a50776d402ebb37c71e93 (diff)
Filter out mixmaster outputs to stderr that are no problem
Diffstat (limited to 'Echolot/Pinger')
-rw-r--r--Echolot/Pinger/Mix.pm18
1 files changed, 12 insertions, 6 deletions
diff --git a/Echolot/Pinger/Mix.pm b/Echolot/Pinger/Mix.pm
index 1b774a2..1bb3a0d 100644
--- a/Echolot/Pinger/Mix.pm
+++ b/Echolot/Pinger/Mix.pm
@@ -66,7 +66,8 @@ sub ping($$$$$) {
Echolot::Log::warn("Cannot close $mixcfg: $!."),
return 0;
- my $pid = open(KID, "|-");
+ my($wtr, $rdr, $err);
+ my $pid = open3($wtr, $rdr, $err, "|-");
defined $pid or
Echolot::Log::warn("Cannot fork for calling mixmaster: $!."),
return 0;
@@ -76,13 +77,18 @@ sub ping($$$$$) {
Echolot::Log::warn("Cannot exec mixpinger: $!.");
exit(1);
};
- print KID "From: Echolot Pinger <$address>\n"
- if $with_from;
- print KID "To: $to\n\n$body\n";
- close (KID);
+ my $msg;
+ $msg .= "From: Echolot Pinger <$address>\n" if $with_from;
+ $msg .= "To: $to\n\n$body\n";
+ my ($stdout, $stderr, undef) = Echolot::Tools::readwrite_gpg($msg, $wtr, $rdr, $err, undef);
waitpid $pid, 0;
-
+
+ $stderr =~ s/^Chain: .*//mg;
+ $stderr =~ s/^Warning: The message has a From: line.*//mg;
+ Echolot::Log::info("Mixmaster said on stdout: $stdout");
+ Echolot::Log::warn("Mixmaster said on stderr: $stderr");
+
return 1;
};