Received: (qmail 51653 invoked by uid 501); 17 Nov 2001 22:54:54 -0000 Message-Id: <20011117225454.51652.qmail@apache.org> Date: 17 Nov 2001 22:54:54 -0000 From: Kurt Brown Reply-To: kurtb149@yahoo.com To: submit@bugz.apache.org Subject: ap_custom_response() function could use "const char *" instead of "char *" X-Send-Pr-Version: 3.110 >Number: 8791 >Category: apache-api >Synopsis: ap_custom_response() function could use "const char *" instead of "char *" >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: apache >Arrival-Date: Sat Nov 17 15:00:00 PST 2001 >Closed-Date: Sun Nov 18 07:35:15 PST 2001 >Last-Modified: Sun Nov 18 07:35:15 PST 2001 >Originator: kurtb149@yahoo.com >Release: 2.0.29-dev >Organization: >Environment: $ uname -a Linux dirac.netpos.com 2.4.7-10 #1 Thu Sep 6 16:46:36 EDT 2001 i686 unknown $ cc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98) >Description: I suggest changing the signature of ap_custom_response() to use a "const char *" instead of a "char *". Such a change would better support c++ std::string. >How-To-Repeat: >Fix: $ cvs diff -u include/http_core.h server/core.c Index: include/http_core.h =================================================================== RCS file: /home/cvspublic/httpd-2.0/include/http_core.h,v retrieving revision 1.52 diff -u -r1.52 http_core.h --- include/http_core.h 2001/09/17 21:07:35 1.52 +++ include/http_core.h 2001/11/17 22:39:20 @@ -254,7 +254,7 @@ * or a URL * @deffunc void ap_custom_response(request_rec *r, int status, char *string) */ -AP_DECLARE(void) ap_custom_response(request_rec *r, int status, char *string); +AP_DECLARE(void) ap_custom_response(request_rec *r, int status, const char *string); /** * Check for a definition from the server command line Index: server/core.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/server/core.c,v retrieving revision 1.98 diff -u -r1.98 core.c --- server/core.c 2001/11/15 20:49:53 1.98 +++ server/core.c 2001/11/17 22:39:23 @@ -943,7 +943,7 @@ return NULL; } -AP_DECLARE(void) ap_custom_response(request_rec *r, int status, char *string) +AP_DECLARE(void) ap_custom_response(request_rec *r, int status, const char *string) { core_dir_config *conf = ap_get_module_config(r->per_dir_config, &core_module); >Release-Note: >Audit-Trail: From: Ian Holsman To: apache-bugdb@apache.org Cc: submit@bugz.apache.org, kurtb149@yahoo.com Subject: Re: apache-api/8791: ap_custom_response() function could use "const char *" instead of "char *" Date: Sat, 17 Nov 2001 19:13:48 -0800 Thanks Kurt. your patch has been comitted. Kurt Brown wrote: >>Number: 8791 >>Category: apache-api >>Synopsis: ap_custom_response() function could use "const char *" instead of "char *" >>Confidential: no >>Severity: non-critical >>Priority: medium >>Responsible: apache >>State: open >>Quarter: >>Keywords: >>Date-Required: >>Class: change-request >>Submitter-Id: apache >>Arrival-Date: Sat Nov 17 15:00:00 PST 2001 >>Closed-Date: >>Last-Modified: >>Originator: kurtb149@yahoo.com >>Release: 2.0.29-dev >>Organization: >> > apache > >>Environment: >> > $ uname -a > Linux dirac.netpos.com 2.4.7-10 #1 Thu Sep 6 16:46:36 EDT 2001 i686 unknown > > $ cc -v > Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs > gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98) > >>Description: >> > I suggest changing the signature of ap_custom_response() to use a "const char *" instead of a "char *". Such a change would better support c++ std::string. > >>How-To-Repeat: >> > >>Fix: >> > $ cvs diff -u include/http_core.h server/core.c > > Index: include/http_core.h > =================================================================== > RCS file: /home/cvspublic/httpd-2.0/include/http_core.h,v > retrieving revision 1.52 > diff -u -r1.52 http_core.h > --- include/http_core.h 2001/09/17 21:07:35 1.52 > +++ include/http_core.h 2001/11/17 22:39:20 > @@ -254,7 +254,7 @@ > * or a URL > * @deffunc void ap_custom_response(request_rec *r, int status, char *string) > */ > -AP_DECLARE(void) ap_custom_response(request_rec *r, int status, char *string); > +AP_DECLARE(void) ap_custom_response(request_rec *r, int status, const char *string); > > /** > * Check for a definition from the server command line > Index: server/core.c > =================================================================== > RCS file: /home/cvspublic/httpd-2.0/server/core.c,v > retrieving revision 1.98 > diff -u -r1.98 core.c > --- server/core.c 2001/11/15 20:49:53 1.98 > +++ server/core.c 2001/11/17 22:39:23 > @@ -943,7 +943,7 @@ > return NULL; > } > > -AP_DECLARE(void) ap_custom_response(request_rec *r, int status, char *string) > +AP_DECLARE(void) ap_custom_response(request_rec *r, int status, const char *string) > { > core_dir_config *conf = > ap_get_module_config(r->per_dir_config, &core_module); > > >>Release-Note: >>Audit-Trail: >>Unformatted: >> > [In order for any reply to be added to the PR database, you need] > [to include in the Cc line and make sure the] > [subject line starts with the report component and number, with ] > [or without any 'Re:' prefixes (such as "general/1098:" or ] > ["Re: general/1098:"). If the subject doesn't match this ] > [pattern, your message will be misfiled and ignored. The ] > ["apbugs" address is not added to the Cc line of messages from ] > [the database automatically because of the potential for mail ] > [loops. If you do not include this Cc, your reply may be ig- ] > [nored unless you are responding to an explicit request from a ] > [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ] > > > State-Changed-From-To: open-closed State-Changed-By: slive State-Changed-When: Sun Nov 18 07:35:14 PST 2001 State-Changed-Why: Patch committed by ianh. >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]