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/lib/apr/include apr_buf.h
Date Wed, 12 Jul 2000 22:00:08 GMT
rbb         00/07/12 15:00:08

  Modified:    src/lib/apr/buckets ap_buf.c
               src/lib/apr/include apr_buf.h
  Log:
  Add an End-Of-Stream bucket type.  This also makes a couple of relatively
  minor bug fixes in the buckets code.  The bug fixes where found because
  of the EOS bucket, so I am including them in this patch.
  
  Revision  Changes    Path
  1.6       +14 -2     apache-2.0/src/lib/apr/buckets/ap_buf.c
  
  Index: ap_buf.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_buf.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ap_buf.c	2000/07/12 16:57:52	1.5
  +++ ap_buf.c	2000/07/12 22:00:07	1.6
  @@ -84,6 +84,9 @@
               newbuf->data = ap_rmem_create();
               newbuf->free = NULL;
               break;
  +        case AP_BUCKET_eos:
  +            newbuf->data = NULL;
  +            newbuf->free = NULL;
           case AP_BUCKET_file:
           case AP_BUCKET_filename:
           case AP_BUCKET_cached_entity:
  @@ -96,7 +99,7 @@
   
   APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e)
   {
  -    if (e->free) {
  +    if (e->free != NULL) {
           e->free(e);
       }
       free(e);
  @@ -174,6 +177,7 @@
           if (a->tail) {
               a->tail->next = b->head;
           }
  +        b->head->prev = a->tail;
   	a->tail = b->tail;
           if (!a->head) {
               a->head = b->head;
  @@ -196,6 +200,9 @@
       do {
           iov_used = ap_bucket_brigade_to_iovec(b, vec, 16);
           status = iol_writev(iol, vec, iov_used, &bytes);
  +
  +        ap_consume_buckets(b, 16);
  +
           if (status != APR_SUCCESS) {
               return status;
           }
  @@ -224,6 +231,8 @@
               return ap_mmap_get_char_str(b->data);
           case AP_BUCKET_rmem:
               return ap_rmem_get_char_str(b->data);
  +        case AP_BUCKET_eos:
  +            return NULL;
           case AP_BUCKET_file:
           case AP_BUCKET_filename:
           case AP_BUCKET_cached_entity:
  @@ -244,6 +253,8 @@
               return ap_mmap_get_len(b->data);
           case AP_BUCKET_rmem:
               return ap_rmem_get_len(b->data);
  +        case AP_BUCKET_eos:
  +            return 0;
           case AP_BUCKET_file:
           case AP_BUCKET_filename:
           case AP_BUCKET_cached_entity:
  @@ -297,7 +308,7 @@
           }
           else {
               b->tail->next = ap_bucket_list_create();
  -            b->tail->next->prev = b->tail->next;
  +            b->tail->next->prev = b->tail;
               b->tail = b->tail->next;
               b->tail->bucket = r;
           }
  @@ -305,3 +316,4 @@
   
       return k;
   }
  +
  
  
  
  1.7       +4 -1      apache-2.0/src/lib/apr/include/apr_buf.h
  
  Index: apr_buf.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_buf.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apr_buf.h	2000/07/12 16:57:54	1.6
  +++ apr_buf.h	2000/07/12 22:00:08	1.7
  @@ -73,7 +73,10 @@
       AP_BUCKET_mmap,
       AP_BUCKET_filename,
       AP_BUCKET_cached_entity,
  -    AP_BUCKET_URI
  +    AP_BUCKET_URI,
  +    AP_BUCKET_eos        /* End-of-stream bucket.  Special case to say this is
  +                          * the end of the bucket so all data should be sent
  +                          * immediately. */
   } ap_bucket_color_e;
   
   typedef struct ap_bucket ap_bucket;
  
  
  

Mime
View raw message