httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: cvs commit: httpd-2.0/modules/filters mod_include.h
Date Wed, 25 Apr 2001 17:17:26 GMT
On 25 Apr 2001 jwoolley@apache.org wrote:

>   Log:
>   Fix a reference to "ctx" in mod_include's CREATE_ERROR_BUCKET macro
>   to "cntx", which is the actual name of the argument to that macro.  It
>   accidentally worked before because all of the callers of the macro happen
>   to be passing in a variable named "ctx".  If one of them were to ever try
>   to pass in a context named something else, bad things would happen.
>
>   Revision  Changes    Path
>   1.18      +1 -1      httpd-2.0/modules/filters/mod_include.h
>
>   Index: mod_include.h
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.h,v
>   retrieving revision 1.17
>   retrieving revision 1.18
>   diff -u -d -u -r1.17 -r1.18
>   --- mod_include.h	2001/04/10 16:57:27	1.17
>   +++ mod_include.h	2001/04/25 17:07:40	1.18
>   @@ -175,7 +175,7 @@
>    {                                                                 \
>        apr_size_t e_wrt;                                             \
>        t_buck = apr_bucket_heap_create(cntx->error_str,              \
>   -                                   ctx->error_length, 1, &e_wrt); \
>   +                                  cntx->error_length, 1, &e_wrt); \
>        APR_BUCKET_INSERT_BEFORE(h_ptr, t_buck);                      \
>                                                                      \
>        if (ins_head == NULL) {                                       \


PS: This is a nit, since it's a matter of performance in the error path,
but why on earth does the CREATE_ERROR_BUCKET macro create a copy-to-heap
heap bucket for the error message??  The message is either a const string
if the default is used or essentially const (allocated from cmd->pool) if
a custom one is used.  Sounds like a good place to use an immortal bucket
if you ask me.

--Cliff


--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message