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 16:57:59 GMT
rbb         00/07/12 09:57:55

  Modified:    src/lib/apr/buckets ap_buf.c
               src/lib/apr/include apr_buf.h
  Log:
  A couple of bucket fixes.  These just keep us from seg faulting in some
  cases.
  
  Revision  Changes    Path
  1.5       +12 -6     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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ap_buf.c	2000/07/12 14:48:08	1.4
  +++ ap_buf.c	2000/07/12 16:57:52	1.5
  @@ -130,7 +130,7 @@
   {
       ap_bucket_list *b;
       
  -    b = malloc(sizeof(*b));
  +    b = calloc(1, sizeof(*b));
       return b;
   }
   
  @@ -262,7 +262,8 @@
       int j, k, rv;
       ap_ssize_t i;
   
  -    if (b->tail->bucket->color == AP_BUCKET_rwmem) {
  +    if (b->tail && b->tail->bucket && 
  +        b->tail->bucket->color == AP_BUCKET_rwmem) {
           ap_bucket_rwmem *rw;
           rw = b->tail->bucket->data;
           /* I have no idea if this is a good idea or not.  Probably not.
  @@ -291,10 +292,15 @@
           /* This really requires an API.  Basically we are just adding
            * a bucket to a bucket list.
            */
  -        b->tail->next = ap_bucket_list_create();
  -        b->tail->next->prev = b->tail->next;
  -        b->tail = b->tail->next;
  -        b->tail->bucket = r;
  +        if (b->tail->bucket == NULL) {
  +            b->tail->bucket = r;
  +        }
  +        else {
  +            b->tail->next = ap_bucket_list_create();
  +            b->tail->next->prev = b->tail->next;
  +            b->tail = b->tail->next;
  +            b->tail->bucket = r;
  +        }
       }
   
       return k;
  
  
  
  1.6       +1 -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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- apr_buf.h	2000/07/12 16:47:19	1.5
  +++ apr_buf.h	2000/07/12 16:57:54	1.6
  @@ -133,7 +133,7 @@
                                                    ap_bucket_brigade *a, 
                                                    ap_iol *iol);
   
  -APR_EXPORT(int) ap_brigade_vputs(ap_bucket_brigade *b, ...);
  +APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va);
   
   /*   ******  Bucket List Functions  *****  */
   
  
  
  

Mime
View raw message