use tokio_crate::io::{AsyncReadExt, AsyncWriteExt};
-use crate::write_rr;
+use crate::validation::write_rr;
use crate::rr::*;
use crate::ser::*;
// Only read the answers (skip authorities and additional) as that's all we care about.
let mut rrsig_opt = None;
for _ in 0..answers {
- let rr = emap(parse_wire_packet_rr(&mut read, &resp))?;
- write_rr(&rr, 0, proof);
+ let (rr, ttl) = emap(parse_wire_packet_rr(&mut read, &resp))?;
+ write_rr(&rr, ttl, proof);
if let RR::RRSig(rrsig) = rr { rrsig_opt = Some(rrsig); }
}
Ok(rrsig_opt)
#[cfg(test)]
mod tests {
use super::*;
- use crate::*;
+ use crate::validation::*;
use rand::seq::SliceRandom;