Messages in this thread |  | | From | Paul Mackerras <> | Date | Thu, 18 Oct 2001 22:15:40 +1000 (EST) | Subject | Re: libz, libbz2, ramfs and cramfs |
| |
I wrote:
> I added a deflateOutputPending routine which returns the number of > bytes of data that the compressor has pending to give to you.
I just checked and in fact ppp_deflate doesn't use this.
> I added a check so that it is legal to set strm->next_out to NULL and > the de/compressor will just discard its output data. This is useful > on the sending side for PPP-deflate because there are situations where > the transmitted data has to be added to the compressor's history but > may not be transmitted in compressed form.
ppp_deflate doesn't use next_out = NULL in this case, but it does use next_out = NULL when we are compressing a packet and the compressed packet turns out to be larger than the uncompressed. With deflate there is a limit on how much larger the compressed packet would be, so it would be possible to give it a small extra buffer on the stack instead of using next_out = NULL.
If we were going to standardize on a newer zlib in the kernel, I could change ppp_deflate to cope with that without too much pain, I think. The main thing I would want to add is a way to check what state the decompressor is in at the end of each packet - we want strm->state->blocks->mode == LENS at that point, which is not something that can be checked using the existing zlib interface.
Paul. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |