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 http_protocol.c http_request.c
Date Tue, 17 Oct 2000 00:24:38 GMT
rbb         00/10/16 17:24:37

  Modified:    .        STATUS
               src      CHANGES
               src/ap   Makefile.in
               src/include ap_buckets.h
               src/main http_core.c http_protocol.c http_request.c
  Log:
  Add a flush bucket type.  This bucket advises filters to flush any data
  they are currently storing.  There is no way we can force them to flush,
  but we can advise.  This also adds the code to ap_rflush to use flush
  buckets, although it isn't enabled yet.  I will enable it once we remove
  buff from the code.  I also removed all calls to ap_rflush that are either
  immediately before or immediately after a call to ap_finalize_protocol.
  ap_finalize_protocol sends an EOS bucket, which also advises filters to
  flush their data, so having both calls right next to each other is
  redundant.
  
  Revision  Changes    Path
  1.143     +2 -4      apache-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/apache-2.0/STATUS,v
  retrieving revision 1.142
  retrieving revision 1.143
  diff -u -r1.142 -r1.143
  --- STATUS	2000/10/16 23:15:54	1.142
  +++ STATUS	2000/10/17 00:24:28	1.143
  @@ -1,5 +1,5 @@
   Apache 2.0 STATUS:
  -Last modified at [$Date: 2000/10/16 23:15:54 $]
  +Last modified at [$Date: 2000/10/17 00:24:28 $]
   
   Release:
   
  @@ -19,9 +19,7 @@
                   WIN32 and OS2 need review [William Rowe, Brian Harvard]
   
       * All of the bucket types must be implemented.  The list can be found
  -      in src/include/ap_buckets.h. May need to implement a bucket type
  -      to tell filters to flush any pending content. See http_protocol.c:
  -      ap_rflush()
  +      in src/include/ap_buckets.h.
   
       * Remove Buff from the code.  Some buff functionality is currently 
         missing: input translation filter, translation of protocol data for 
  
  
  
  1.278     +6 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.277
  retrieving revision 1.278
  diff -u -r1.277 -r1.278
  --- CHANGES	2000/10/16 23:15:54	1.277
  +++ CHANGES	2000/10/17 00:24:29	1.278
  @@ -1,4 +1,10 @@
   Changes with Apache 2.0a8
  +  *) Add a flush bucket.  This allows modules to signal that the filters
  +     should all flush whatever data they currently have.  There is no way
  +     to actually force them to do this, so if a filter ignores this bucket,
  +     that's life, but at least we can try with this.
  +     [Ryan Bloom]
  +
     *) Add an output filter for sub-requests.  This filter just strips the
        EOS bucket so that we don't confuse the main request's core output
        filter by sending multiple EOS buckets.  This change also makes sub
  
  
  
  1.12      +1 -1      apache-2.0/src/ap/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/ap/Makefile.in,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Makefile.in	2000/10/10 22:09:25	1.11
  +++ Makefile.in	2000/10/17 00:24:30	1.12
  @@ -3,6 +3,6 @@
   LTLIBRARY_SOURCES = ap_cache.c ap_base64.c ap_sha1.c ap_hooks.c ap_buckets.c \
   	ap_buckets_eos.c ap_buckets_simple.c ap_buckets_refcount.c \
   	ap_buckets_heap.c ap_buckets_mmap.c ap_buckets_pipe.c \
  -	ap_buckets_file.c ap_buckets_socket.c
  +	ap_buckets_file.c ap_buckets_socket.c ap_buckets_flush.c
   
   include $(top_srcdir)/build/ltlib.mk
  
  
  
  1.41      +12 -1     apache-2.0/src/include/ap_buckets.h
  
  Index: ap_buckets.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/ap_buckets.h,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- ap_buckets.h	2000/10/16 14:08:23	1.40
  +++ ap_buckets.h	2000/10/17 00:24:32	1.41
  @@ -250,6 +250,7 @@
   
   #define AP_BUCKET_REMOVE(e)	AP_RING_REMOVE((e), link)
   
  +#define AP_BUCKET_IS_FLUSH(e)       (e->type == &ap_flush_type)
   #define AP_BUCKET_IS_EOS(e)         (e->type == &ap_eos_type)
   #define AP_BUCKET_IS_FILE(e)        (e->type == &ap_file_type)
   #define AP_BUCKET_IS_PIPE(e)        (e->type == &ap_pipe_type)
  @@ -516,6 +517,7 @@
   int ap_insert_bucket_type(const ap_bucket_type *type);
   
   /* All of the bucket types implemented by the core */
  +extern const ap_bucket_type ap_flush_type;
   extern const ap_bucket_type ap_eos_type;
   extern const ap_bucket_type ap_file_type;
   extern const ap_bucket_type ap_heap_type;
  @@ -608,13 +610,22 @@
   
   /**
    * Create an End of Stream bucket.  This indicates that there is no more data
  - * coming from down the filter stack
  + * coming from down the filter stack.  All filters should flush at this point.
    * @return The new bucket, or NULL if allocation failed
    * @deffunc ap_bucket *ap_bucket_create_eos(void)
    */
   AP_DECLARE(ap_bucket *) ap_bucket_create_eos(void);
   AP_DECLARE(ap_bucket *) ap_bucket_make_eos(ap_bucket *b);
   
  +/**
  + * Create a flush  bucket.  This indicates that filters should flush their
  + * data.  There is no garauntee that they will flush it, but this is the
  + * best we can do.
  + * @return The new bucket, or NULL if allocation failed
  + * @deffunc ap_bucket *ap_bucket_create_flush(void)
  + */
  +AP_DECLARE(ap_bucket *) ap_bucket_create_flush(void);
  +AP_DECLARE(ap_bucket *) ap_bucket_make_flush(ap_bucket *b);
   
   /**
    * Create a bucket referring to long-lived data.
  
  
  
  1.174     +2 -2      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.173
  retrieving revision 1.174
  diff -u -r1.173 -r1.174
  --- http_core.c	2000/10/16 23:15:55	1.173
  +++ http_core.c	2000/10/17 00:24:35	1.174
  @@ -3117,7 +3117,7 @@
               destroy_me = NULL;
           }
           if (AP_BUCKET_IS_EOS(e)  || AP_BUCKET_IS_FILE(e) ||
  -            AP_BUCKET_IS_PIPE(e)) {
  +            AP_BUCKET_IS_PIPE(e) || AP_BUCKET_IS_FLUSH(e)) {
               pass_the_brigade = 1;
           }
           else {
  @@ -3441,7 +3441,7 @@
           /* Completed iterating over the brigades, now determine if we want to
            * buffer the brigade or send the brigade out on the network
            */
  -        if (!fd && (!more) && (nbytes < MIN_SIZE_TO_WRITE) &&
!AP_BUCKET_IS_EOS(e)) {
  +        if (!fd && (!more) && (nbytes < MIN_SIZE_TO_WRITE) &&
!AP_BUCKET_IS_EOS(e) && !AP_BUCKET_IS_FLUSH(e)) {
               ap_save_brigade(f, &ctx->b, &b);
               return APR_SUCCESS;
           }
  
  
  
  1.180     +10 -9     apache-2.0/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
  retrieving revision 1.179
  retrieving revision 1.180
  diff -u -r1.179 -r1.180
  --- http_protocol.c	2000/10/16 23:15:55	1.179
  +++ http_protocol.c	2000/10/17 00:24:35	1.180
  @@ -2810,18 +2810,22 @@
   
   AP_DECLARE(int) ap_rflush(request_rec *r)
   {
  -    /* ### this is probably incorrect, but we have no mechanism for telling
  -       ### the filter chain to flush any content they may be holding.
  -
  -       ### add a FLUSH bucket type?
  -    */
  -
       apr_status_t rv;
   
       if ((rv = ap_bflush(r->connection->client)) != APR_SUCCESS) {
           check_first_conn_error(r, "rflush", rv);
           return EOF;
       }
  +#if USE_FLUSH_BUCKET
  +    /* we should be using a flush bucket to flush the stack, not buff code. */
  +    ap_bucket_brigade *bb;
  +    ap_bucket *b;
  +
  +    bb = ap_brigade_create(r->pool);
  +    b = ap_bucket_create_flush();
  +    AP_BRIGADE_INSERT_TAIL(bb, b);
  +    ap_pass_brigade(r->output_filters, bb);
  +#endif
       return 0;
   }
   
  @@ -3155,7 +3159,6 @@
   
           if (r->header_only) {
               ap_finalize_request_protocol(r);
  -            ap_rflush(r);
               return;
           }
       }
  @@ -3176,7 +3179,6 @@
           if (custom_response[0] == '\"') {
               ap_rputs(custom_response + 1, r);
               ap_finalize_request_protocol(r);
  -            ap_rflush(r);
               return;
           }
           /*
  @@ -3223,7 +3225,6 @@
           ap_rputs("</BODY></HTML>\n", r);
       }
       ap_finalize_request_protocol(r);
  -    ap_rflush(r);
   }
   
   AP_IMPLEMENT_HOOK_RUN_ALL(int,post_read_request,
  
  
  
  1.61      +0 -6      apache-2.0/src/main/http_request.c
  
  Index: http_request.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- http_request.c	2000/10/16 23:15:55	1.60
  +++ http_request.c	2000/10/17 00:24:36	1.61
  @@ -1355,12 +1355,6 @@
           return;
       }
   
  -    /* We need to flush the data out at this point.  We probably only want to
  -     * do this on the main request, but this is fine for an initial patch.
  -     * Once we look into this more, we won't flush sub-requests.
  -     */
  -    ap_rflush(r);
  -
       /* Take care of little things that need to happen when we're done */
       ap_finalize_request_protocol(r);
   }
  
  
  

Mime
View raw message