httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: httpd-test/perl-framework/c-modules/test_pass_brigade mod_test_pass_brigade.c
Date Fri, 29 Mar 2002 08:20:40 GMT
jwoolley    02/03/29 00:20:40

  Modified:    perl-framework/c-modules/input_body_filter
                        mod_input_body_filter.c
               perl-framework/c-modules/nntp_like mod_nntp_like.c
               perl-framework/c-modules/test_pass_brigade
                        mod_test_pass_brigade.c
  Log:
  Update to new bucket brigades API
  
  Revision  Changes    Path
  1.9       +7 -5      httpd-test/perl-framework/c-modules/input_body_filter/mod_input_body_filter.c
  
  Index: mod_input_body_filter.c
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/c-modules/input_body_filter/mod_input_body_filter.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -d -u -r1.8 -r1.9
  --- mod_input_body_filter.c	7 Mar 2002 09:28:23 -0000	1.8
  +++ mod_input_body_filter.c	29 Mar 2002 08:20:40 -0000	1.9
  @@ -85,13 +85,14 @@
                                        apr_read_type_e block,
                                        apr_off_t readbytes)
   {
  +    request_rec *r = f->r;
  +    conn_rec *c = r->connection;
       apr_status_t rv;
  -    apr_pool_t *p = f->r->pool;
       input_body_ctx_t *ctx = f->ctx;
   
       if (!ctx) {
  -        f->ctx = ctx = apr_pcalloc(f->r->pool, sizeof(*ctx));
  -        ctx->b = apr_brigade_create(f->r->pool);
  +        f->ctx = ctx = apr_pcalloc(r->pool, sizeof(*ctx));
  +        ctx->b = apr_brigade_create(r->pool, c->bucket_alloc);
       }
   
       if (APR_BRIGADE_EMPTY(ctx->b))
  @@ -124,9 +125,10 @@
           APR_BUCKET_REMOVE(bucket);
   
           if (len) {
  -            char *reversed = apr_pstrndup(p, data, len);
  +            char *reversed = apr_pstrndup(r->pool, data, len);
               reverse_string(reversed, len);
  -            bucket = apr_bucket_pool_create(reversed, len, p);
  +            bucket = apr_bucket_pool_create(reversed, len, r->pool,
  +                                            c->bucket_alloc);
           }
   
           APR_BRIGADE_INSERT_TAIL(bb, bucket);
  
  
  
  1.5       +8 -7      httpd-test/perl-framework/c-modules/nntp_like/mod_nntp_like.c
  
  Index: mod_nntp_like.c
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/c-modules/nntp_like/mod_nntp_like.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -d -u -r1.4 -r1.5
  --- mod_nntp_like.c	25 Jan 2002 01:12:28 -0000	1.4
  +++ mod_nntp_like.c	29 Mar 2002 08:20:40 -0000	1.5
  @@ -72,7 +72,7 @@
       apr_bucket_brigade *bb;
       apr_status_t rv;
   
  -    bb = apr_brigade_create(c->pool);
  +    bb = apr_brigade_create(c->pool, c->bucket_alloc);
   
       rv = ap_get_brigade(c->input_filters, bb, AP_MODE_INIT, 
                           APR_BLOCK_READ, 0);
  @@ -85,15 +85,16 @@
   static apr_status_t nntp_like_send_welcome(conn_rec *c)
   {
       apr_bucket *bucket;
  -    apr_bucket_brigade *bb = apr_brigade_create(c->pool);
  +    apr_bucket_brigade *bb = apr_brigade_create(c->pool, c->bucket_alloc);
   
   #define NNTP_LIKE_WELCOME \
       "200 localhost - ready\r\n"
   
  -    bucket = apr_bucket_transient_create(NNTP_LIKE_WELCOME,
  -                                         strlen(NNTP_LIKE_WELCOME));
  +    bucket = apr_bucket_immortal_create(NNTP_LIKE_WELCOME,
  +                                        sizeof(NNTP_LIKE_WELCOME)-1,
  +                                        c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, bucket);
  -    APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_flush_create());
  +    APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_flush_create(c->bucket_alloc));
   
       return ap_pass_brigade(c->output_filters, bb);
   }
  @@ -121,7 +122,7 @@
       }
   
       /* just for testing purposes, this is the same logic as mod_echo */
  -    bb = apr_brigade_create(c->pool);
  +    bb = apr_brigade_create(c->pool, c->bucket_alloc);
   
       for (;;) {
           if ((rv = ap_get_brigade(c->input_filters, bb,
  @@ -133,7 +134,7 @@
               break;
           }
   
  -        APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_flush_create());
  +        APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_flush_create(c->bucket_alloc));
           ap_pass_brigade(c->output_filters, bb);    
       }
   
  
  
  
  1.3       +4 -2      httpd-test/perl-framework/c-modules/test_pass_brigade/mod_test_pass_brigade.c
  
  Index: mod_test_pass_brigade.c
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/c-modules/test_pass_brigade/mod_test_pass_brigade.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -d -u -r1.2 -r1.3
  --- mod_test_pass_brigade.c	21 Nov 2001 01:27:52 -0000	1.2
  +++ mod_test_pass_brigade.c	29 Mar 2002 08:20:40 -0000	1.3
  @@ -23,6 +23,7 @@
   
   static int test_pass_brigade_handler(request_rec *r)
   {
  +    conn_rec *c = r->connection;
       long total=0, remaining=1;
       char *buff;
       int buff_size = 8192;
  @@ -46,8 +47,9 @@
       while (total < remaining) {
           int left = (remaining - total);
           int len = left <= buff_size ? left : buff_size;
  -        apr_bucket_brigade *bb = apr_brigade_create(r->pool);
  -        apr_bucket *bucket = apr_bucket_heap_create(buff, len, 1);
  +        apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +        apr_bucket *bucket = apr_bucket_heap_create(buff, len, NULL,
  +                                                    c->bucket_alloc);
           apr_status_t status;
   
           APR_BRIGADE_INSERT_TAIL(bb, bucket);
  
  
  

Mime
View raw message