You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by TO...@aol.com on 2001/09/21 17:16:33 UTC

Dr. Mark Adler on ZLIB OS_CODE

Hello all...
This is Kevin Kiley

In an effort to resolve a pending issue with regards to the
inclusion of code that supports dynamic IETF Content-Encoding
I checked out the whole OS_CODE issue in ZLIB.

If you use the OS_CODE manifest constant in whatever code
you end up with in the source tree then you are automatically
establishing a dependency on the ZUTIL.H header which does
not normally come with standard binary distributions of ZLIB.

Normally you only get ZLIB.H and ZCONF.H unless you have
downloaded/installed a source-code level distribution of ZLIB.

If you don't want to include ZLIB source in the Apache tree
( still recommended because of patches needed for inflate()
memory leaks ) then any dependency on ZUTIL.H might still force 
your users to download a copy of ZLIB that they don't normally have.

By substituing 0x03 for OS_CODE you remove the dependency
on ZUTIL.H but you are doing then is 'hard-coding' the OS
indicator byte as 'UNIX default'.

The OS code means nothing to the compressor and it is only
really used by decompressors that are also required to do
formatting of the decompressed data. I did some testing and
discovered that all browsers tested don't really care about the
OS code and the formatting will be handled by the presentation
layer elements in the user-agent. 

So whatever codebase you end up with that uses ZLIB, if you
don't include a source-level version of ZLIB in the Apache tree
and you want Apache to be able to compile with most people's
pre-installed ZLIB implementations just use 0x03 instead of 
OS_CODE and they shouldn't need ZUTIL.H.

I decided to verify this with Dr. Mark Adler ( co-author of ZLIB )
just to make sure...

> > Kevin Kiley wrote...
> >
> >Is the OS_CODE part of the ZLIB header ever really used?
>  
>  Dr. Mark Adler responded...
>
>  It is only useful when the decompressed data is expected to be text, 
>  and the software after the decompressor would like some clue about 
>  how to translate end-of-line characters.  I have no idea if any 
>  browsers make any use of it, but I doubt it.  I assume that 
>  html/javascript/etc. interpreters already know how to handle 
>  different end-of-line conventions without bothering with conversion.
>  
>  > Kevin Kiley wrote...
>  >
>  >Can the Apache guys just forget the OS_CODE or set it to 
>  >'UNIX default' like ZUTIL.H does right in the Server code and, hence, 
>  >eliminate any dependency on ZUTIL.H?
>  
>  Dr. Mark Adler responded...
>
>  I would say yes, almost certainly.
>  
>  mark