Function read_and_decompress

Source
pub(crate) async fn read_and_decompress<S, SP>(
    runtime: &SP,
    stream: S,
    maxlen: usize,
    result: &mut Vec<u8>,
) -> RequestResult<()>
where S: AsyncRead + Unpin, SP: SleepProvider,
Expand description

Helper: download directory information from stream and decompress it into a result buffer. Assumes that buf is empty.

If we get more than maxlen bytes after decompression, give an error.

Returns the status of our download attempt, stores any data that we were able to download into result. Existing contents of result are overwritten.