apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@apache.org
Subject cvs commit: apr-util/buckets apr_buckets_file.c
Date Fri, 02 Feb 2001 21:02:23 GMT
gregames    01/02/02 13:02:22

  Modified:    buckets  apr_buckets_file.c
  Log:
  fix a leaky bucket.
  
  Submitted by:    Cliff Woolley <cliffwoolley@yahoo.com>
  
  Revision  Changes    Path
  1.26      +8 -14     apr-util/buckets/apr_buckets_file.c
  
  Index: apr_buckets_file.c
  ===================================================================
  RCS file: /home/cvs/apr-util/buckets/apr_buckets_file.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -d -b -u -r1.25 -r1.26
  --- apr_buckets_file.c	2001/01/24 08:26:19	1.25
  +++ apr_buckets_file.c	2001/02/02 21:02:19	1.26
  @@ -164,21 +164,15 @@
       return APR_SUCCESS;
   }
   
  -static apr_status_t file_split(apr_bucket *e, apr_off_t offset)
  +static void file_destroy(void *data)
   {
  -    apr_bucket *b;
  -    apr_bucket_shared *s;
  -    apr_bucket_shared *temp = e->data;
       apr_bucket_file *f;
  -
  -    apr_bucket_split_shared(e, offset);
  -    b = APR_BUCKET_NEXT(e);
  -
  -    s = b->data;
  -    f = s->data;
  -    s->start = offset + temp->start;
   
  -    return APR_SUCCESS;
  +    f = apr_bucket_destroy_shared(data);
  +    if (f == NULL) {
  +        return;
  +    }
  +    free(f);
   }
   
   APU_DECLARE(apr_bucket *) apr_bucket_make_file(apr_bucket *b, apr_file_t *fd,
  @@ -211,9 +205,9 @@
   
   APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_file = {
       "FILE", 5,
  -    free,
  +    file_destroy,
       file_read,
       apr_bucket_setaside_notimpl,
  -    file_split,
  +    apr_bucket_split_shared,
       apr_bucket_copy_shared
   };
  
  
  

Mime
View raw message