ike: do not log empty notify array

Ticket: #5167
pull/7652/head
Philippe Antoine 4 years ago committed by Victor Julien
parent 262a93ce18
commit 632581ac95

@ -214,12 +214,14 @@ fn log_ikev2(tx: &IKETransaction, jb: &mut JsonBuilder) -> Result<(), JsonError>
jb.open_object("ikev2")?;
jb.set_uint("errors", tx.errors as u64)?;
jb.open_array("notify")?;
for notify in tx.notify_types.iter() {
jb.append_string(&format!("{:?}", notify))?;
if !tx.notify_types.is_empty() {
jb.open_array("notify")?;
for notify in tx.notify_types.iter() {
jb.append_string(&format!("{:?}", notify))?;
}
jb.close()?;
}
jb.close()?;
jb.close()?;
Ok(())
}

Loading…
Cancel
Save