From: Paul Mackerras <paulus@samba.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: libz, libbz2, ramfs and cramfs
Date: Thu, 18 Oct 2001 17:15:51 +1000 (EST) [thread overview]
Message-ID: <15310.33191.397106.8530@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <3BCE4BB5.8060603@zytor.com>
In-Reply-To: <19978.1003206943@kao2.melbourne.sgi.com> <3BCBE29D.CFEC1F05@alacritech.com> <9qjfki$ob5$1@cesium.transmeta.com> <15310.18125.367838.562789@cargo.ozlabs.ibm.com> <3BCE4BB5.8060603@zytor.com>
H. Peter Anvin writes:
> What kind of extensions?
/me pages that bit of his brain in...
I added a Z_PACKET_FLUSH value for the `flush' parameter. For deflate
it is like Z_SYNC_FLUSH except that it omits the 00 00 ff ff bytes
that Z_SYNC_FLUSH will put on the end of the output. For inflate it
checks that we are at a packet boundary once we have consumed all the
input, i.e. that we have seen the "000" block type code (meaning a
"stored" block) and we are waiting for the 2-byte length.
I added a deflateOutputPending routine which returns the number of
bytes of data that the compressor has pending to give to you.
I added an inflateIncomp routine which takes uncompressed data and
adds it to the decompressor history. The reason this is needed is
that if PPP-deflate goes to compress a packet and it expands, it sends
the packet uncompressed instead. The receiver still needs to add the
packet data to the history though, since the packet data has been
processed by the compressor on the sending end.
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.
I also made various other minor changes so it would all compile
happily combined together into one file and in the kernel environment.
None of these changes affect its behaviour if you use it in the normal
way, i.e. if you don't use Z_PACKET_FLUSH and don't set strm->next_out
to NULL.
Most of these things are optimizations to reduce time and memory usage
for PPP-deflate. The one thing that I don't think could be done with
the stock zlib is the check for the decompressor state that
Z_PACKET_FLUSH on inflate() provides. That is not *strictly*
necessary since it is just a check, but it does give us some chance of
detecting if we receive a corrupted compressed packet that still has
the correct FCS.
Paul.
next prev parent reply other threads:[~2001-10-18 7:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-15 13:06 libz, libbz2, ramfs and cramfs Cristiano Paris
2001-10-15 22:53 ` H. Peter Anvin
2001-10-16 4:35 ` Keith Owens
2001-10-16 7:32 ` Matt D. Robinson
2001-10-17 8:31 ` H. Peter Anvin
2001-10-18 3:04 ` Paul Mackerras
2001-10-18 3:25 ` H. Peter Anvin
2001-10-18 7:15 ` Paul Mackerras [this message]
2001-10-18 12:15 ` Paul Mackerras
2001-10-18 17:33 ` H. Peter Anvin
2001-10-17 8:45 ` David Woodhouse
2001-10-16 17:36 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15310.33191.397106.8530@cargo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox