Brett,

I think I got the gzip thing working, at least the flag part.

It turns out that all the plumbing is already in AOLserver. The only thing 
missing was the ability to call Ns_ConnSetGzipFlag as a tcl command.

The gzip/compress core code is in 'compress.c', but the gzip functions are in 
the zlib module. Since the zlib module has a tcl command, I added a 
subcommand to this to handle the switch. 

There is a little more to it, but basically here is the addition:

    case ZSetFlagIdx:
        if (Tcl_GetBooleanFromObj(interp, objv[2], &compress) != 0) {
            return TCL_ERROR;
        }
        Ns_Log(Notice, "Setting Gzip Flag to %i", compress);
        Ns_ConnSetGzipFlag( Ns_GetConn(), compress );
        break;
    }

The modified code is here:

http://rmadilo.com/files/nszlib/


There are some notes on this for the existing adp compression:

ns_section ns/server/server1
ns_param gzip true;      # Enable compression.
ns_param gziplevel 4;    # Compression level.
ns_param gzipmin 4096;   # Minimum size before gzip.

You use the API Like this:

ns_zlib setflag 1 ;#(or 0) (any boolean value actually)


tom jackson


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

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to