On 01/12/2010, at 11:31 AM, Alexey Pechnikov wrote:

> The code below does not produce valid output in AOL 4.5.1. But why?..

does it produce valid output in other versions of nsd?

The nsreturnz sources seem to be saying that a response with the gzip 
Content-Encoding isn't just a plain gzip compressed copy of the uncompressed 
body -

http://aolserver.cvs.sourceforge.net/viewvc/aolserver/nsreturnz/nsreturnz.c

  /* copy the gzip header into the first 10 bytes, wiping out the
     first 2 bytes from compress2.  Add 8 to outlen for the gzip
     header (10-2), subtract 4 because we're ignoring the last 4
     bytes of compress2 */


is there any reason you're not just using ns_returnz ?


cheers

Russell


> ns_register_proc GET  /headers  ad_headers_proc
> 
> proc ad_headers_proc {ignore} {
>     set result {}
>     set headers [ns_conn headers]
>     for {set i 0} {$i < [ns_set size $headers]} {incr i} {
>         set key [ns_set key $headers $i]
>         set value [ns_set value $headers $i]
>         append result "$key: $value\n"
>     }
>     ns_updateheader Content-Encoding gzip
>     ns_return 200 text/plain [ns_zlib gzip $result]
> }


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to