~kf5jwc/dns-server-rs

f3f0b043666da5518ec70216b1d850df3e5410b5 — Kyle Jones 6 months ago 3c1aff3
Allow a better method for grabbing the entire packet buffer
1 files changed, 4 insertions(+), 0 deletions(-)

M src/dns_packet/byte_packet_buffer.rs
M src/dns_packet/byte_packet_buffer.rs => src/dns_packet/byte_packet_buffer.rs +4 -0
@@ 40,6 40,10 @@ impl BytePacketBuffer {
        Ok(&self.buf[start..start+len as usize])
    }

    pub fn raw_buffer(&self) -> &[u8] {
        &self.buf[0..self.pos]
    }

    pub fn read(&mut self) -> Result<u8> {
        if self.pos >= self.buf.len() {
            return Err(Error::new(ErrorKind::InvalidInput, "End of buffer"));