mirror of
https://github.com/NLnetLabs/dnst.git
synced 2026-09-26 11:44:55 +02:00
Flush zonefile before running notify command.
This commit is contained in:
+11
-1
@@ -432,7 +432,6 @@ impl Signer {
|
||||
todo!();
|
||||
}
|
||||
if need_resign {
|
||||
println!("Signing zone");
|
||||
signer_state.config_modified = signer_config_modified;
|
||||
signer_state.keyset_state_modified = keyset_state_modified;
|
||||
let zonefile_modified = Self::file_modified(sc.zonefile_in.clone())?;
|
||||
@@ -1074,6 +1073,8 @@ impl Signer {
|
||||
}
|
||||
}
|
||||
|
||||
writer.flush()?;
|
||||
|
||||
if !sc.notify_command.is_empty() {
|
||||
let output = Command::new(&sc.notify_command[0])
|
||||
.args(&sc.notify_command[1..])
|
||||
@@ -1534,6 +1535,15 @@ enum FileOrStdout<T: io::Write, U: io::Write> {
|
||||
Stdout(Stream<U>),
|
||||
}
|
||||
|
||||
impl<T: io::Write, U: io::Write> FileOrStdout<T, U> {
|
||||
fn flush(&mut self) -> Result<(), std::io::Error> {
|
||||
match self {
|
||||
FileOrStdout::File(f) => f.flush(),
|
||||
FileOrStdout::Stdout(s) => (s as &Stream<_>).flush(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: io::Write, U: io::Write> fmt::Write for FileOrStdout<T, U> {
|
||||
fn write_str(&mut self, s: &str) -> std::fmt::Result {
|
||||
match self {
|
||||
|
||||
Reference in New Issue
Block a user