Re: Code updates

Mark Swanson <[email protected]>
Newsgroups gmane.network.tux
Organization Web Service Solutions
Message-ID <[email protected]>
This works. Squid understands the Vary: header.

Unfortunately, the gzipped files never get sent when I use the Vary header 
with people using squid. This is not optimal, but acceptable because 
compression is used in the other cases where it is supported.

To make this work, I used Tux's ability to generate my own header like this:

    echo 1 > /proc/sys/net/tux/compression
    echo 0 > /proc/sys/net/tux/extra_html_header_size
    echo "Vary: Accept-Encoding" >/proc/sys/net/tux/extra_html_header
    echo 21 > /proc/sys/net/tux/extra_html_header_size

However, there is a bug in that the extra header is placed after the \r\n\r\n.
I fixed this by making Tux's proto_http.c look like this:
(COPY_STATIC_PART(4, curr); comes last.
        /*
         * Possibly add an extra HTML header:
         */
        if (tux_extra_html_header_size && mime && !strcmp(mime->type, 
"text/html")) {
                unsigned int len = tux_extra_html_header_size;

                //memcpy(curr, tux_extra_html_header, len);
                //curr += len;
                curr += sprintf(curr, "\r\n%s", tux_extra_html_header);
        }
        COPY_STATIC_PART(4, curr);

If this doesn't work for you let me know.

If you know how to make compression also work with SQUID please let me know. 
Apparently newer 2.5 (beta I think) versions of squid can cache different 
data based on the negotiation (compression or not). If anyone gets this to 
work it would be great if they would post to this list.

Cheers.


-- 
Schedule your world with ScheduleWorld.com
http://www.ScheduleWorld.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.