mod_cache and brigade

2002-09-24 Thread Estrade Matthieu

Hi,

After i did my unusable proxy patch for multiple brigade handling by 
mod_cache, i tried to patch the mod_cache.
My code is doing:

receiving one brigade
if EOS inside, cache it and cache cache-saved_brigade if not null.
if no EOS, save brigade in cache-saved_brigade
w8 for another brigade, until EOS inside.

This code is working,
I controlled the data written in the cache and his length.

But i have a bug, and i really don't understand why
When i call manual.css (2 brigades) alone 
http://127.0.0.1/manual/style/css/manual.css:

first time, it's cached by the mod_cache and served by proxy
second time, it's served by cache


data received are the same, i did a MD5 on it !
that's why i think the code is working.

When i call http://127.0.0.1/manual which is using manual.css, the same 
as above:

first time, it's cached by mod_cache and served by proxy
second time, the manual.css is not used by the browser. (netscape US 
langage)

i sniffed the connection btw the reverse proxy and the client.
the manual.css data are sent correctly to the client, but there is a 
difference btw:

served by proxy: HTTP/1.1 and no keep alive
served by cache: HTTP/1.1 and keepalive + content-length. and age=value

the others headers_out are the same.

I will continue to search why this bug is happening.
I insert my code as attachment, sorry for the french comment inside if left.


Matthieu


/* 
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in
 *the documentation and/or other materials provided with the
 *distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *if any, must include the following acknowledgment:
 *   This product includes software developed by the
 *Apache Software Foundation (http://www.apache.org/).
 *Alternately, this acknowledgment may appear in the software itself,
 *if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names Apache and Apache Software Foundation must
 *not be used to endorse or promote products derived from this
 *software without prior written permission. For written
 *permission, please contact [EMAIL PROTECTED]
 *
 * 5. Products derived from this software may not be called Apache,
 *nor may Apache appear in their name, without prior written
 *permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * 
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * http://www.apache.org/.
 *
 * Portions of this software are based upon public domain software
 * originally written at the National Center for Supercomputing Applications,
 * University of Illinois, Urbana-Champaign.
 */

#define CORE_PRIVATE

#include mod_cache.h

module AP_MODULE_DECLARE_DATA cache_module;
APR_OPTIONAL_FN_TYPE (ap_cache_generate_key) * cache_generate_key;

/* -- */


/* Handles for cache filters, resolved at startup to eliminate
 * a name-to-function mapping on each request
 */
 static ap_filter_rec_t *cache_in_filter_handle;
 static ap_filter_rec_t *cache_out_filter_handle;
 static ap_filter_rec_t *cache_conditional_filter_handle;

/*
 * CACHE handler
 * -
 *
 * Can we deliver this request from the cache?
 * If yes:
 *   deliver the content by installing the CACHE_OUT filter.
 * If no:
 *   check whether we're allowed to try cache it
 *   If yes:
 * add CACHE_IN filter

Re: mod_cache and brigade

2002-09-24 Thread Matthieu Estrade

Hi again,

Just to say when i put my mozilla/netscape in HTTP/1.0, i don't have the 
bug i speak about in my last mail.

Matthieu




Re: mod_cache and brigade

2002-09-24 Thread Paul J. Reder

Matthieu,

Could you possibly provide your changes as an attached diff instead of
the entire file. Your version of the file has changed the spacing of most
of the file so I can't easily determine what you changed.

Thanks,

Paul J. Reder

Matthieu Estrade wrote:

 Hi again,
 
 Just to say when i put my mozilla/netscape in HTTP/1.0, i don't have the 
 bug i speak about in my last mail.
 
 Matthieu
 
 


-- 
Paul J. Reder
---
The strength of the Constitution lies entirely in the determination of each
citizen to defend it.  Only if every single citizen feels duty bound to do
his share in this defense are the constitutional rights secure.
-- Albert Einstein