httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: httpd-2.0/server error_bucket.c
Date Sat, 22 Sep 2001 22:37:04 GMT
jwoolley    01/09/22 15:37:04

  Modified:    server   error_bucket.c
  Log:
  revert buckets sms phase 1 patch. the group wants to get rid of SMS, so
  the buckets can't use it.  I'll implement a free-list scheme private
  to the buckets next.  in the meanwhile we're back to using malloc/free
  directly instead of via the std sms.
  
  Revision  Changes    Path
  1.9       +8 -17     httpd-2.0/server/error_bucket.c
  
  Index: error_bucket.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/error_bucket.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -d -u -r1.8 -r1.9
  --- error_bucket.c	2001/08/26 03:13:36	1.8
  +++ error_bucket.c	2001/09/22 22:37:04	1.9
  @@ -68,20 +68,17 @@
       return APR_SUCCESS;
   }
   
  -static void error_destroy(void *data) {
  -    ap_bucket_error *h = data;
  -    apr_sms_free(h->sms, h);
  -}
  -
   AP_DECLARE(apr_bucket *) ap_bucket_error_make(apr_bucket *b, int error, 
   		const char *buf, apr_pool_t *p)
   {
       ap_bucket_error *h;
   
  -    h = (ap_bucket_error *)apr_sms_malloc(b->sms, sizeof(*h));
  +    h = malloc(sizeof(*h));
  +    if (h == NULL) {
  +        return NULL;
  +    }
       h->status = error;
       h->data = (buf) ? apr_pstrdup(p, buf) : NULL;
  -    h->sms = b->sms;
   
       b->length = 0;
       b->start  = 0;
  @@ -93,22 +90,16 @@
   AP_DECLARE(apr_bucket *) ap_bucket_error_create(int error, 
   		const char *buf, apr_pool_t *p)
   {
  -    apr_sms_t *sms;
  -    apr_bucket *b;
  -    
  -    if (!apr_bucket_global_sms) {
  -        apr_sms_std_create(&apr_bucket_global_sms);
  -    }
  -    sms = apr_bucket_global_sms;
  -    b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
  +    apr_bucket *b = (apr_bucket *)malloc(sizeof(*b));
  +
       APR_BUCKET_INIT(b);
  -    b->sms = sms;
  +    b->free = free;
       return ap_bucket_error_make(b, error, buf, p);
   }
   
   AP_DECLARE_DATA const apr_bucket_type_t ap_bucket_type_error = {
       "ERROR", 5,
  -    error_destroy,
  +    free,
       error_read,
       apr_bucket_setaside_notimpl,
       apr_bucket_split_notimpl,
  
  
  

Mime
View raw message