httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_core.c
Date Sat, 07 Oct 2000 18:10:10 GMT
rbb         00/10/07 11:10:07

  Modified:    src/include httpd.h
               src/main http_core.c
  Log:
  The core filter should not be using its own brigade inside its own ctx
  structure.  This changes the core_output_filter to use a brigade inside
  the conn_rec.  Think of this as analagous to the BUFF in the conn_rec.
  The idea is that if we have pipelined requests, and it isn't worth it to
  send the last bit of data from the first request, we want to save that
  extra bit of data to the conn_rec, so that the next request sends it
  automatically.
  
  Revision  Changes    Path
  1.94      +3 -1      apache-2.0/src/include/httpd.h
  
  Index: httpd.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v
  retrieving revision 1.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- httpd.h	2000/10/07 05:41:58	1.93
  +++ httpd.h	2000/10/07 18:09:59	1.94
  @@ -887,9 +887,11 @@
       /** A list of output filters to be used for this connection
        *  @defvar ap_filter_t *filters */
       struct ap_filter_t *output_filters;
  +    /** Location to store data about to be written to the client.
  +     *  @defvar ap_bucket_brigade *client_data */
  +    struct ap_bucket_brigade *client_data;
       /** bytes left to read in the current request body */
       long remaining;
  -
   };
   
   /* Per-vhost config... */
  
  
  
  1.149     +5 -12     apache-2.0/src/main/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v
  retrieving revision 1.148
  retrieving revision 1.149
  diff -u -r1.148 -r1.149
  --- http_core.c	2000/10/07 00:37:18	1.148
  +++ http_core.c	2000/10/07 18:10:02	1.149
  @@ -3293,9 +3293,6 @@
    * is to send the headers if they haven't already been sent, and then send
    * the actual data.
    */
  -typedef struct CORE_OUTPUT_FILTER_CTX {
  -    ap_bucket_brigade *b;
  -} core_output_filter_ctx_t;
   #define MAX_IOVEC_TO_WRITE 16
   static int core_output_filter(ap_filter_t *f, ap_bucket_brigade *b)
   {
  @@ -3304,7 +3301,6 @@
       apr_ssize_t bytes_sent = 0, nbytes = 0;
       ap_bucket *e;
       conn_rec *c = f->c;
  -    core_output_filter_ctx_t *ctx = f->ctx;
   
       apr_ssize_t nvec = 0;
       apr_ssize_t nvec_trailers= 0;
  @@ -3315,14 +3311,11 @@
       apr_ssize_t flen = 0;
       apr_off_t foffset = 0;
   
  -    if (ctx == NULL) {
  -        f->ctx = ctx = apr_pcalloc(c->pool, sizeof(core_output_filter_ctx_t));
  -    }
       /* If we have a saved brigade, concatenate the new brigade to it */
  -    if (ctx->b) {
  -        AP_BRIGADE_CONCAT(ctx->b, b);
  -        b = ctx->b;
  -        ctx->b = NULL;
  +    if (c->client_data) {
  +        AP_BRIGADE_CONCAT(c->client_data, b);
  +        b = c->client_data;
  +        c->client_data = NULL;
       }
   
       /* Hijack any bytes in BUFF and prepend it to the brigade. */
  @@ -3379,7 +3372,7 @@
            * buffer the brigade or send the brigade out on the network
            */
           if (!fd && (!more) && (nbytes < MIN_SIZE_TO_WRITE) &&
(e->type != AP_BUCKET_EOS)) {
  -            ap_save_brigade(f, &ctx->b, &b);
  +            ap_save_brigade(f, &c->client_data, &b);
               return APR_SUCCESS;
           }
           if (fd) {
  
  
  

Mime
View raw message