Hi Paul,

No problem, i send the diff on the list
sorry, but it's the first patches i send so i discover how work in group :)
I also dunno how  to make patch and ignore indentation

Matthieu



Paul J. Reder wrote:

> 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
>>
>>
>
>


--- mod_cache.c 2002-09-24 16:02:13.000000000 +0200
+++ mod_cache.c-patched 2002-09-24 16:06:04.000000000 +0200
@@ -627,6 +627,37 @@
                }
                size += e->length;
            }
+           ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+                        "FInd %i data in received brigade and total size is %i",
+                        size, size + cache->saved_size);
+
+           if ((!all_buckets_here) && (!unresolved_length)) {
+               if (cache->saved_brigade == NULL) {
+                   cache->saved_brigade =
+                       apr_brigade_create(r->pool,
+                                          r->connection->bucket_alloc);
+               }
+
+               if (!APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(in))) {
+                   ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+                                "Copy new brigade, bucket per bucket, in 
+saved_brigade");
+
+                   APR_BRIGADE_FOREACH(e, in) {
+                       apr_bucket *z;
+                       apr_bucket_copy(e, &z);
+                       APR_BRIGADE_INSERT_TAIL(cache->saved_brigade, z);
+                   }
+
+                   cache->saved_size += size;
+                   cache->exp = exp;
+                   cache->lastmod = lastmod;
+                   cache->info = info;
+                   return ap_pass_brigade(f->next, in);
+               }
+               else
+                   all_buckets_here = 1;
+
+           }
 
            if (!all_buckets_here) {
                /* Attempt to set aside a copy of a partial response
@@ -642,19 +673,22 @@
                    (cache->saved_size + size >
                     conf->max_streaming_buffer_size)) {
 
-                   ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+                   ap_log_error(APLOG_MARK, APLOG_DEBUG, 0,
+                                r->server,
                                 "cache: not caching streamed response for "
                                 "%s because length %s", url,
                                 (unresolved_length ?
                                  "cannot be determined" :
                                  "> CacheMaxStreamingBuffer"));
 
-                   if (cache->saved_brigade != NULL) {
-                       apr_brigade_destroy(cache->saved_brigade);
-                       cache->saved_brigade = NULL;
-                       cache->saved_size = 0;
-                   }
-                   ap_remove_output_filter(f);
+                   /*
+                      if (cache->saved_brigade != NULL) {
+                      apr_brigade_destroy(cache->saved_brigade);
+                      cache->saved_brigade = NULL;
+                      cache->saved_size = 0;
+                      }
+                      ap_remove_output_filter(f);
+                    */
                    return ap_pass_brigade(f->next, in);
                }
 
@@ -698,7 +732,12 @@
                    APR_BRIGADE_CONCAT(cache->saved_brigade, in);
                    in = cache->saved_brigade;
                    size += cache->saved_size;
+                   ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+                                "Split point avec taille addition %i", size);
+
+
                }
+
            }
        }
     }
@@ -738,6 +777,7 @@
        rv = cache_create_entity(r, cache->types, url, size);
     }
 
+
     if (rv != OK) {
        /* Caching layer declined the opportunity to cache the response */
        ap_remove_output_filter(f);
@@ -762,6 +802,7 @@
      * too.
      */
 
+
     /* Read the date. Generate one if one is not supplied */
     dates = apr_table_get(r->headers_out, "Date");
     if (dates != NULL) {
@@ -790,6 +831,7 @@
        date = info->date;
     }
 
+
     /* set response_time for HTTP/1.1 age calculations */
     info->response_time = now;
 
@@ -847,6 +889,7 @@
        in = apr_brigade_split(in, split_point);
        apr_brigade_destroy(already_sent);
     }
+
     return ap_pass_brigade(f->next, in);
 }
 
@@ -1056,8 +1099,9 @@
     return NULL;
 }
 
-static int cache_post_config(apr_pool_t * p, apr_pool_t * plog,
-                            apr_pool_t * ptemp, server_rec *s)
+static int
+cache_post_config(apr_pool_t * p, apr_pool_t * plog,
+                 apr_pool_t * ptemp, server_rec *s)
 {
     /* This is the means by which unusual (non-unix) os's may find alternate
      * means to run a given command (e.g. shebang/registry parsing on Win32)
@@ -1086,12 +1130,15 @@
                  "A partial URL prefix below which caching is disabled"),
     AP_INIT_TAKE1("CacheMaxExpire", set_cache_maxex, NULL, RSRC_CONF,
                  "The maximum time in seconds to cache a document"),
-    AP_INIT_TAKE1("CacheDefaultExpire", set_cache_defex, NULL, RSRC_CONF,
+    AP_INIT_TAKE1("CacheDefaultExpire", set_cache_defex, NULL,
+                 RSRC_CONF,
                  "The default time in seconds to cache a document"),
-    AP_INIT_FLAG("CacheIgnoreNoLastMod", set_cache_ignore_no_last_mod, NULL,
+    AP_INIT_FLAG("CacheIgnoreNoLastMod", set_cache_ignore_no_last_mod,
+                NULL,
                 RSRC_CONF,
                 "Ignore Responses where there is no Last Modified Header"),
-    AP_INIT_FLAG("CacheIgnoreCacheControl", set_cache_ignore_cachecontrol,
+    AP_INIT_FLAG("CacheIgnoreCacheControl",
+                set_cache_ignore_cachecontrol,
                 NULL,
                 RSRC_CONF,
                 "Ignore requests from the client for uncached content"),
@@ -1099,10 +1146,12 @@
                  RSRC_CONF,
                  "The factor used to estimate Expires date from "
                  "LastModified date"),
-    AP_INIT_TAKE1("CacheForceCompletion", set_cache_complete, NULL, RSRC_CONF,
+    AP_INIT_TAKE1("CacheForceCompletion", set_cache_complete, NULL,
+                 RSRC_CONF,
                  "Percentage of download to arrive for the cache to force "
                  "complete transfer"),
-    AP_INIT_TAKE1("CacheMaxStreamingBuffer", set_max_streaming_buffer, NULL,
+    AP_INIT_TAKE1("CacheMaxStreamingBuffer", set_max_streaming_buffer,
+                 NULL,
                  RSRC_CONF,
                  "Maximum number of bytes of content to buffer for "
                  "a streamed response"),

Reply via email to