modcplusplus-devel Mailing List for mod_cplusplus (Page 15)
Brought to you by:
gr84b8,
johnksterling
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(14) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
|
Feb
(44) |
Mar
(8) |
Apr
(33) |
May
(5) |
Jun
(5) |
Jul
(2) |
Aug
(4) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(26) |
Sep
(9) |
Oct
|
Nov
(5) |
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(11) |
Jun
(7) |
Jul
(2) |
Aug
(11) |
Sep
|
Oct
|
Nov
(7) |
Dec
(4) |
2005 |
Jan
(13) |
Feb
(7) |
Mar
(10) |
Apr
(11) |
May
(2) |
Jun
|
Jul
(8) |
Aug
(9) |
Sep
|
Oct
(4) |
Nov
|
Dec
|
2006 |
Jan
(12) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(6) |
2007 |
Jan
(4) |
Feb
(13) |
Mar
(10) |
Apr
(56) |
May
(69) |
Jun
(93) |
Jul
(116) |
Aug
(62) |
Sep
(15) |
Oct
(14) |
Nov
(18) |
Dec
(11) |
2008 |
Jan
(8) |
Feb
(13) |
Mar
(32) |
Apr
(22) |
May
(15) |
Jun
(10) |
Jul
(18) |
Aug
(10) |
Sep
(16) |
Oct
(12) |
Nov
(41) |
Dec
(40) |
2009 |
Jan
(33) |
Feb
(14) |
Mar
(32) |
Apr
(47) |
May
(103) |
Jun
(100) |
Jul
(72) |
Aug
(21) |
Sep
(22) |
Oct
(30) |
Nov
(7) |
Dec
(19) |
2010 |
Jan
(8) |
Feb
(7) |
Mar
(40) |
Apr
(53) |
May
(67) |
Jun
(62) |
Jul
(26) |
Aug
(37) |
Sep
(13) |
Oct
(3) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael S. <mic...@ca...> - 2005-01-26 00:18:22
|
Hi compilation of 1.4.3 now works fine on my Gentoo system. I created a beta quality ebuild for mod_cplusplus-1.4.3 (tested on 4 x86 machines). I'm using mod_cplusplus together with SIPfoundry.org's sipXpbx, a software PBX for the SIP protocol. Instructions on how to use my ebuild can be found here: http://wiki.calivia.com/index.php/SIPfoundry.org_sipX_Ebuilds_for_Gentoo_Linux Anyone to test the ebuild and give feedback is more than welcome. Mike John Sterling wrote: > Interesting. Feel free to send the code along, if you'd like - i'll > have a look. > > John > > On Jan 24, 2005, at 7:23 PM, Michael Steinmann wrote: > >> Thanks John >> >> by looking at 'make check' I saw that the problem seems to be the >> CPPHandler that gets loaded by mod_cplusplus. mod_cplusplus loads >> just fine with the 'make check' config. >> >> will now look into the CPPHandler issue. It has been written for >> mod_cplusplus-1.2 and confirmed to work in 1.3, but not 1.4. >> Mike >> >> John K. Sterling wrote: >> >>> Hi Michael - >>> couple of questions: >>> 1) have you run 'make check'? It runs the test cases against your >>> apache >>> install with the built in config file. I'd be curious if that >>> segfaults, >>> too. >>> 2) What MPM are you running (prefork?) >>> 3) Can you send your config file over? I'll try to reproduce. >>> Thanks - >>> John >>> >>>> Hi >>>> >>>> I managed to compile mod_cplusplus-1.4.3 on Gentoo. >>>> >>>> ./autogen.sh --with-apxs=/usr/sbin/apxs2 >>>> ./autogen.sh --with-apxs=/usr/sbin/apxs2 >>>> make >>>> cp src/.libs/libmod_cplusplus.* /usr/lib/apache2/modules/ >>>> cp include/* /usr/include/apache2/ >>>> >>>> Apache segfaults when it loads the module. >>>> >>>> The end of my apache startup log: >>>> >>>> [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>>> suexec_module >>>> [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>>> disk_cache_module >>>> [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>>> file_cache_module >>>> [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>>> mem_cache_module >>>> [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>>> cgi_module [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded >>>> module >>>> cplusplus_module >>>> [EOF] >>>> >>>> # gdb apache2 core >>>> GNU gdb 6.0 >>>> Copyright 2003 Free Software Foundation, Inc. >>>> GDB is free software, covered by the GNU General Public License, >>>> and you >>>> are welcome to change it and/or distribute copies of it under certain >>>> conditions. >>>> Type "show copying" to see the conditions. >>>> There is absolutely no warranty for GDB. Type "show warranty" for >>>> details. This GDB was configured as "i686-pc-linux-gnu"...(no >>>> debugging >>>> symbols found)...Using host libthread_db library >>>> "/lib/libthread_db.so.1". >>>> >>>> Core was generated by `/usr/sbin/apache2 -f /etc/httpd/httpd.conf >>>> -DSSL >>>> -e debug -E /var/log/httpd'. >>>> Program terminated with signal 11, Segmentation fault. >>>> >>>> [---snip---] >>>> >>>> Reading symbols from /usr/lib/libmd5.so.0...done. >>>> Loaded symbols for /usr/lib/libmd5.so.0 >>>> Reading symbols from /usr/lib/libmysqlclient.so.12...done. >>>> Loaded symbols for /usr/lib/libmysqlclient.so.12 >>>> #0 0x409c26a5 in pcre_free_substring () from /usr/lib/libpcre.so.0 >>>> (gdb) >>>> (gdb) bt >>>> #0 0x409c26a5 in pcre_free_substring () from /usr/lib/libpcre.so.0 #1 >>>> 0x08137cc0 in ?? () >>>> #2 0x407811a8 in ?? () from /usr/lib/libglib-2.0.so.0 >>>> #3 0x40781dc0 in _g_debug_flags () from /usr/lib/libglib-2.0.so.0 #4 >>>> 0x40732c7c in _g_messages_thread_private_init () from >>>> /usr/lib/libglib-2.0.so.0 >>>> >>>> I have dev-libs/libpcre-4.5 installed via emerge/portage. >>>> >>>> Any idea, somebody >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF.Net email is sponsored by: IntelliVIEW -- Interactive >>>> Reporting >>>> Tool for open source databases. Create drag-&-drop reports. Save >>>> time by >>>> over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. >>>> Download a FREE copy at http://www.intelliview.com/go/osdn_nl >>>> _______________________________________________ >>>> Modcplusplus-devel mailing list >>>> Mod...@li... >>>> https://lists.sourceforge.net/lists/listinfo/modcplusplus-devel >>> >> > |
From: John S. <jo...@st...> - 2005-01-25 00:27:04
|
Interesting. Feel free to send the code along, if you'd like - i'll have a look. John On Jan 24, 2005, at 7:23 PM, Michael Steinmann wrote: > Thanks John > > by looking at 'make check' I saw that the problem seems to be the > CPPHandler that gets loaded by mod_cplusplus. mod_cplusplus loads just > fine with the 'make check' config. > > will now look into the CPPHandler issue. It has been written for > mod_cplusplus-1.2 and confirmed to work in 1.3, but not 1.4. > Mike > > John K. Sterling wrote: >> Hi Michael - >> couple of questions: >> 1) have you run 'make check'? It runs the test cases against your >> apache >> install with the built in config file. I'd be curious if that >> segfaults, >> too. >> 2) What MPM are you running (prefork?) >> 3) Can you send your config file over? I'll try to reproduce. >> Thanks - >> John >>> Hi >>> >>> I managed to compile mod_cplusplus-1.4.3 on Gentoo. >>> >>> ./autogen.sh --with-apxs=/usr/sbin/apxs2 >>> ./autogen.sh --with-apxs=/usr/sbin/apxs2 >>> make >>> cp src/.libs/libmod_cplusplus.* /usr/lib/apache2/modules/ >>> cp include/* /usr/include/apache2/ >>> >>> Apache segfaults when it loads the module. >>> >>> The end of my apache startup log: >>> >>> [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>> suexec_module >>> [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>> disk_cache_module >>> [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>> file_cache_module >>> [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>> mem_cache_module >>> [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>> cgi_module [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded >>> module >>> cplusplus_module >>> [EOF] >>> >>> # gdb apache2 core >>> GNU gdb 6.0 >>> Copyright 2003 Free Software Foundation, Inc. >>> GDB is free software, covered by the GNU General Public License, and >>> you >>> are welcome to change it and/or distribute copies of it under certain >>> conditions. >>> Type "show copying" to see the conditions. >>> There is absolutely no warranty for GDB. Type "show warranty" for >>> details. This GDB was configured as "i686-pc-linux-gnu"...(no >>> debugging >>> symbols found)...Using host libthread_db library >>> "/lib/libthread_db.so.1". >>> >>> Core was generated by `/usr/sbin/apache2 -f /etc/httpd/httpd.conf >>> -DSSL >>> -e debug -E /var/log/httpd'. >>> Program terminated with signal 11, Segmentation fault. >>> >>> [---snip---] >>> >>> Reading symbols from /usr/lib/libmd5.so.0...done. >>> Loaded symbols for /usr/lib/libmd5.so.0 >>> Reading symbols from /usr/lib/libmysqlclient.so.12...done. >>> Loaded symbols for /usr/lib/libmysqlclient.so.12 >>> #0 0x409c26a5 in pcre_free_substring () from /usr/lib/libpcre.so.0 >>> (gdb) >>> (gdb) bt >>> #0 0x409c26a5 in pcre_free_substring () from /usr/lib/libpcre.so.0 >>> #1 >>> 0x08137cc0 in ?? () >>> #2 0x407811a8 in ?? () from /usr/lib/libglib-2.0.so.0 >>> #3 0x40781dc0 in _g_debug_flags () from /usr/lib/libglib-2.0.so.0 #4 >>> 0x40732c7c in _g_messages_thread_private_init () from >>> /usr/lib/libglib-2.0.so.0 >>> >>> I have dev-libs/libpcre-4.5 installed via emerge/portage. >>> >>> Any idea, somebody >>> >>> >>> ------------------------------------------------------- >>> This SF.Net email is sponsored by: IntelliVIEW -- Interactive >>> Reporting >>> Tool for open source databases. Create drag-&-drop reports. Save >>> time by >>> over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. >>> Download a FREE copy at http://www.intelliview.com/go/osdn_nl >>> _______________________________________________ >>> Modcplusplus-devel mailing list >>> Mod...@li... >>> https://lists.sourceforge.net/lists/listinfo/modcplusplus-devel > |
From: Michael S. <ms...@ca...> - 2005-01-25 00:22:08
|
Thanks John by looking at 'make check' I saw that the problem seems to be the CPPHandler that gets loaded by mod_cplusplus. mod_cplusplus loads just fine with the 'make check' config. will now look into the CPPHandler issue. It has been written for mod_cplusplus-1.2 and confirmed to work in 1.3, but not 1.4. Mike John K. Sterling wrote: > Hi Michael - > > couple of questions: > > 1) have you run 'make check'? It runs the test cases against your apache > install with the built in config file. I'd be curious if that segfaults, > too. > 2) What MPM are you running (prefork?) > 3) Can you send your config file over? I'll try to reproduce. > > Thanks - > > John > > >>Hi >> >>I managed to compile mod_cplusplus-1.4.3 on Gentoo. >> >>./autogen.sh --with-apxs=/usr/sbin/apxs2 >>./autogen.sh --with-apxs=/usr/sbin/apxs2 >>make >>cp src/.libs/libmod_cplusplus.* /usr/lib/apache2/modules/ >>cp include/* /usr/include/apache2/ >> >>Apache segfaults when it loads the module. >> >>The end of my apache startup log: >> >>[Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>suexec_module >>[Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>disk_cache_module >>[Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>file_cache_module >>[Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>mem_cache_module >>[Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module >>cgi_module [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded >>module >>cplusplus_module >>[EOF] >> >># gdb apache2 core >>GNU gdb 6.0 >>Copyright 2003 Free Software Foundation, Inc. >>GDB is free software, covered by the GNU General Public License, and you >>are welcome to change it and/or distribute copies of it under certain >>conditions. >>Type "show copying" to see the conditions. >>There is absolutely no warranty for GDB. Type "show warranty" for >>details. This GDB was configured as "i686-pc-linux-gnu"...(no debugging >>symbols found)...Using host libthread_db library >>"/lib/libthread_db.so.1". >> >>Core was generated by `/usr/sbin/apache2 -f /etc/httpd/httpd.conf -DSSL >>-e debug -E /var/log/httpd'. >>Program terminated with signal 11, Segmentation fault. >> >>[---snip---] >> >>Reading symbols from /usr/lib/libmd5.so.0...done. >>Loaded symbols for /usr/lib/libmd5.so.0 >>Reading symbols from /usr/lib/libmysqlclient.so.12...done. >>Loaded symbols for /usr/lib/libmysqlclient.so.12 >>#0 0x409c26a5 in pcre_free_substring () from /usr/lib/libpcre.so.0 >>(gdb) >>(gdb) bt >>#0 0x409c26a5 in pcre_free_substring () from /usr/lib/libpcre.so.0 #1 >>0x08137cc0 in ?? () >>#2 0x407811a8 in ?? () from /usr/lib/libglib-2.0.so.0 >>#3 0x40781dc0 in _g_debug_flags () from /usr/lib/libglib-2.0.so.0 #4 >>0x40732c7c in _g_messages_thread_private_init () from >>/usr/lib/libglib-2.0.so.0 >> >>I have dev-libs/libpcre-4.5 installed via emerge/portage. >> >>Any idea, somebody >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting >>Tool for open source databases. Create drag-&-drop reports. Save time by >>over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. >>Download a FREE copy at http://www.intelliview.com/go/osdn_nl >>_______________________________________________ >>Modcplusplus-devel mailing list >>Mod...@li... >>https://lists.sourceforge.net/lists/listinfo/modcplusplus-devel |
From: John K. S. <jo...@st...> - 2005-01-24 16:36:36
|
Hi Michael - couple of questions: 1) have you run 'make check'? It runs the test cases against your apache install with the built in config file. I'd be curious if that segfaults, too. 2) What MPM are you running (prefork?) 3) Can you send your config file over? I'll try to reproduce. Thanks - John > Hi > > I managed to compile mod_cplusplus-1.4.3 on Gentoo. > > ./autogen.sh --with-apxs=/usr/sbin/apxs2 > ./autogen.sh --with-apxs=/usr/sbin/apxs2 > make > cp src/.libs/libmod_cplusplus.* /usr/lib/apache2/modules/ > cp include/* /usr/include/apache2/ > > Apache segfaults when it loads the module. > > The end of my apache startup log: > > [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module > suexec_module > [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module > disk_cache_module > [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module > file_cache_module > [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module > mem_cache_module > [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module > cgi_module [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded > module > cplusplus_module > [EOF] > > # gdb apache2 core > GNU gdb 6.0 > Copyright 2003 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you > are welcome to change it and/or distribute copies of it under certain > conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for > details. This GDB was configured as "i686-pc-linux-gnu"...(no debugging > symbols found)...Using host libthread_db library > "/lib/libthread_db.so.1". > > Core was generated by `/usr/sbin/apache2 -f /etc/httpd/httpd.conf -DSSL > -e debug -E /var/log/httpd'. > Program terminated with signal 11, Segmentation fault. > > [---snip---] > > Reading symbols from /usr/lib/libmd5.so.0...done. > Loaded symbols for /usr/lib/libmd5.so.0 > Reading symbols from /usr/lib/libmysqlclient.so.12...done. > Loaded symbols for /usr/lib/libmysqlclient.so.12 > #0 0x409c26a5 in pcre_free_substring () from /usr/lib/libpcre.so.0 > (gdb) > (gdb) bt > #0 0x409c26a5 in pcre_free_substring () from /usr/lib/libpcre.so.0 #1 > 0x08137cc0 in ?? () > #2 0x407811a8 in ?? () from /usr/lib/libglib-2.0.so.0 > #3 0x40781dc0 in _g_debug_flags () from /usr/lib/libglib-2.0.so.0 #4 > 0x40732c7c in _g_messages_thread_private_init () from > /usr/lib/libglib-2.0.so.0 > > I have dev-libs/libpcre-4.5 installed via emerge/portage. > > Any idea, somebody > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time by > over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Modcplusplus-devel mailing list > Mod...@li... > https://lists.sourceforge.net/lists/listinfo/modcplusplus-devel |
From: Michael S. <ms...@ca...> - 2005-01-24 15:21:38
|
Hi I managed to compile mod_cplusplus-1.4.3 on Gentoo. ./autogen.sh --with-apxs=/usr/sbin/apxs2 ./autogen.sh --with-apxs=/usr/sbin/apxs2 make cp src/.libs/libmod_cplusplus.* /usr/lib/apache2/modules/ cp include/* /usr/include/apache2/ Apache segfaults when it loads the module. The end of my apache startup log: [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module suexec_module [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module disk_cache_module [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module file_cache_module [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module mem_cache_module [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module cgi_module [Mon Jan 24 15:26:38 2005] [debug] mod_so.c(247): loaded module cplusplus_module [EOF] # gdb apache2 core GNU gdb 6.0 Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...(no debugging symbols found)...Using host libthread_db library "/lib/libthread_db.so.1". Core was generated by `/usr/sbin/apache2 -f /etc/httpd/httpd.conf -DSSL -e debug -E /var/log/httpd'. Program terminated with signal 11, Segmentation fault. [---snip---] Reading symbols from /usr/lib/libmd5.so.0...done. Loaded symbols for /usr/lib/libmd5.so.0 Reading symbols from /usr/lib/libmysqlclient.so.12...done. Loaded symbols for /usr/lib/libmysqlclient.so.12 #0 0x409c26a5 in pcre_free_substring () from /usr/lib/libpcre.so.0 (gdb) (gdb) bt #0 0x409c26a5 in pcre_free_substring () from /usr/lib/libpcre.so.0 #1 0x08137cc0 in ?? () #2 0x407811a8 in ?? () from /usr/lib/libglib-2.0.so.0 #3 0x40781dc0 in _g_debug_flags () from /usr/lib/libglib-2.0.so.0 #4 0x40732c7c in _g_messages_thread_private_init () from /usr/lib/libglib-2.0.so.0 I have dev-libs/libpcre-4.5 installed via emerge/portage. Any idea, somebody |
From: Mod C. C. L. <mod...@so...> - 2004-12-14 13:17:40
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : example Dir : mod_cplusplus/example/input_filter Modified Files: test_input.cpp Log Message: add a new parameter passing mechanism to filters that is per server, not per dir =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/example/input_filter/test_input.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- test_input.cpp 18 May 2004 02:50:18 -0000 1.13 +++ test_input.cpp 14 Dec 2004 13:17:03 -0000 1.14 @@ -18,7 +18,8 @@ { ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL, "EXAMPLE modcplusplus input filter!!!!"); - + + ApacheServerRec *pServer = new ApacheServerRec(f->c->base_server); apr_bucket *input_bucket; apr_bucket *output_bucket; @@ -46,8 +47,17 @@ if(ret != APR_SUCCESS) { return ret; } + + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL, + "XXX looking up host param"); + char *pszToLower = get_server_var(pServer, "tolower"); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL, + "done retrieving param"); + if( pszToLower == NULL ) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL, "didn't get cpp var parameter"); + } for(unsigned int n=0 ; n < len ; ++n) { - if(!strncmp(&data[n], "Host", 4)) + if(!strncmp(&data[n], pszToLower, strlen(pszToLower))) new_buf[n]=tolower(data[n]); else new_buf[n] = data[n]; |
From: Mod C. C. L. <mod...@so...> - 2004-12-14 13:17:14
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : include Dir : mod_cplusplus/include Modified Files: apache_handler.h mod_cplusplus.h Log Message: add a new parameter passing mechanism to filters that is per server, not per dir =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/include/apache_handler.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- apache_handler.h 19 Jun 2002 14:11:07 -0000 1.10 +++ apache_handler.h 14 Dec 2004 13:17:04 -0000 1.11 @@ -22,6 +22,7 @@ { protected: char *get_cpp_var(ApacheRequestRec *r, const char *name); + char *get_server_var(ApacheServerRec *r, const char *name); }; =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/include/mod_cplusplus.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- mod_cplusplus.h 19 Jun 2002 14:11:07 -0000 1.13 +++ mod_cplusplus.h 14 Dec 2004 13:17:04 -0000 1.14 @@ -20,6 +20,7 @@ char **protocol_handlers; char **input_filters; char **output_filters; + apr_hash_t *var_hash; } cpp_server_rec; typedef struct { |
From: Mod C. C. L. <mod...@so...> - 2004-12-14 13:17:12
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : src Dir : mod_cplusplus/src Modified Files: apache_handler.cpp mod_cplusplus.c Log Message: add a new parameter passing mechanism to filters that is per server, not per dir =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/src/apache_handler.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- apache_handler.cpp 28 Jun 2004 02:52:32 -0000 1.15 +++ apache_handler.cpp 14 Dec 2004 13:17:04 -0000 1.16 @@ -191,6 +191,18 @@ } } +char *ApacheBase::get_server_var(ApacheServerRec *pServer, const char *name) +{ + cpp_server_rec *server_rec = NULL; + if( !name ) { + return NULL; + } + server_rec = (cpp_server_rec *) + pServer->get_module_config(&cplusplus_module); + char *value = (char *)apr_hash_get(server_rec->var_hash, name, strlen(name)); + return value; +} + char *ApacheBase::get_cpp_var(ApacheRequestRec *pRequest, const char *name) { cpp_config_rec *dir_rec = (cpp_config_rec *) =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/src/mod_cplusplus.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- mod_cplusplus.c 24 May 2004 01:33:54 -0000 1.20 +++ mod_cplusplus.c 14 Dec 2004 13:17:04 -0000 1.21 @@ -52,6 +52,7 @@ cpp_server_rec *new_config = (cpp_server_rec *) apr_pcalloc(p, sizeof(*new_config)); new_config->handler_hash = apr_hash_make(p); + new_config->var_hash = apr_hash_make(p); new_config->input_filter_hash = apr_hash_make(p); new_config->output_filter_hash = apr_hash_make(p); new_config->protocol_hash = apr_hash_make(p); @@ -74,6 +75,17 @@ return load_cpp_module(cmd->server->process->pool, server_rec, name, path_to_so); } +static const char *pass_server_var(cmd_parms *cmd, void *config, + const char *name, + const char *value) +{ + cpp_server_rec *server_rec = (cpp_server_rec *) + ap_get_module_config(cmd->server->module_config, + &cplusplus_module); + apr_hash_set(server_rec->var_hash, name, strlen(name), value); + return NULL; +} + static const char *pass_var(cmd_parms *cmd, void *config, const char *name, const char *value) @@ -232,7 +244,9 @@ RSRC_CONF, "add protocol handler"), AP_INIT_TAKE2("PassCPPVar", pass_var, NULL, OR_FILEINFO, - "pass var to cpp handlers"), + "pass var to cpp handlers via request config (per dir)"), + AP_INIT_TAKE2("PassCPPServerVar", pass_server_var, NULL, RSRC_CONF, + "pass var to cpp handlers via server config"), {NULL} }; |
From: Mod C. C. L. <mod...@so...> - 2004-12-14 13:17:11
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : test Dir : mod_cplusplus/test/t/conf Modified Files: extra.conf.in Log Message: add a new parameter passing mechanism to filters that is per server, not per dir =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/test/t/conf/extra.conf.in,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- extra.conf.in 28 Jun 2004 02:54:44 -0000 1.10 +++ extra.conf.in 14 Dec 2004 13:17:04 -0000 1.11 @@ -33,6 +33,7 @@ AddCPPOutputFilter test_output_filter </Location> +PassCPPServerVar tolower Host <Location /cpp-input> SetHandler cpp-handler AddCPPHandler test_handler |
From: Mod C. C. L. <mod...@so...> - 2004-11-27 03:39:22
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: INSTALL Log Message: update install docs to simplified configure process =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/INSTALL,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- INSTALL 28 Jun 2004 03:02:51 -0000 1.6 +++ INSTALL 27 Nov 2004 03:39:10 -0000 1.7 @@ -1,14 +1,8 @@ -If you have installed apache yourself (e.g. downloading from .org) you should be able to simply run: -./autogen.sh --with-httpd=/path/to/installed/httpd-2.0 +Now to configure mod_cplusplus you only need to specify the path to apxs, for example if apxs is in /usr/sbin - simply type: -If you are using the apache with a linux distrobution this may not be enough. Many distrobutions put apache includes in a strange place like /usr/include/apache2/ (I assume this is so they can support both 1.3 and 2.0 in the same server... although I would prefer /usr/apache2/include....). if you have one of these distrobutions the configure script *might* just find the include files for you. Otherwise you may need to point it at them. For the above example you can try: +./autogen.sh --with-apxs=/usr/sbin/apxs +once that completes type 'make' and then 'make check' to run the tests. - ln -s /usr/include/apache2 /usr/share/apache2/include - mkdir /usr/share/apache2/bin/ - ln -s /usr/bin/apxs2 /usr/share/apache2/bin/apxs - ./autogen.sh --with-httpd=/usr/share/apache2 --with-apr=/usr/include/apr-0 - -NOTE: I am working on making the configure scripts smart enough to detect these types of installs, so this should be a temporary workaround. |
From: Mod C. C. L. <mod...@so...> - 2004-11-27 03:36:29
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: configure.in Log Message: ok, finally clean up the other things in the configure script and derive everything from apxs. =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/configure.in,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- configure.in 26 Nov 2004 18:53:46 -0000 1.21 +++ configure.in 27 Nov 2004 03:36:18 -0000 1.22 @@ -12,93 +12,43 @@ AC_MSG_RESULT($SHLIB_EXT) AC_SUBST(SHLIB_EXT) -AC_MSG_CHECKING(for httpd) -AC_ARG_WITH(httpd, [ --with-httpd Specify path to httpd source directory ], -[ - if test ! -f $withval/build/config_vars.mk; then - AC_MSG_ERROR($withval not a valid source or shadow dir) - fi - - if grep AP_DEBUG "$withval/build/config_vars.mk" > /dev/null; then - CPPFLAGS="$CPPFLAGS -DAP_DEBUG" - fi - if grep AP_HAVE_DESIGNATED_INITIALIZER "$withval/build/config_vars.mk" > /dev/null; then - CPPFLAGS="$CPPFLAGS -DAP_HAVE_DESIGNATED_INITIALIZER" - fi - - AC_MSG_CHECKING(for standard packaging) - searchfile="$withval/include/httpd.h" - if test -f $searchfile ; then - AC_MSG_RESULT(found $searchfile) - HTTPD_DIR=`cd $withval; pwd` - CPPFLAGS="$CPPFLAGS -I$HTTPD_DIR/include" - else - AC_MSG_RESULT($searchfile not found) - AC_MSG_CHECKING(for alternative default packaging) - searchfile="$withval/include/apache2/httpd.h" - if test -f $searchfile ; then - AC_MSG_RESULT(found $searchfile) - HTTPD_DIR="$withval" - CPPFLAGS="$CPPFLAGS -I$withval/include/apache2" - else - AC_MSG_RESULT($searchfile not found) - searchfile="/usr/include/apache2/httpd.h" - if test -f $searchfile ; then - AC_MSG_RESULT(found $searchfile) - HTTPD_DIR="/usr" - CPPFLAGS="$CPPFLAGS -I/usr/include/apache2" - else - AC_MSG_ERROR($searchfile not found. Apache2 installation cannot be located!) - fi - fi - fi - AC_MSG_CHECKING(for apr.h) - AC_ARG_WITH(apr_path, [ --with-apr_path Specify path to apr include directory ], - [ - if test -f $withval/apr.h; then - CPPFLAGS="$CPPFLAGS -I$withval" - AC_MSG_RESULT(found $withval/apr.h) - else - AC_MSG_RESULT($withval not found) - withval="/usr/include/apr-0/apr.h" - if test -f $withval ; then - AC_MSG_RESULT(found $withval) - CPPFLAGS="$CPPFLAGS -I/usr/include/apr-0" - else - AC_MSG_ERROR($withval not found. APR installation cannot be located!) - fi - fi - ],) - AC_MSG_RESULT(found $HTTPD_DIR) -],) AC_MSG_CHECKING(for apxs) AC_ARG_WITH(apxs, [ --with-apxs Specify path to apxs ], [ if test -f $withval; then - INCLUDE_DIR=`$withval -q INCLUDEDIR` + apache_inc=`$withval -q INCLUDEDIR` + apr_inc=`$withval -q APR_INCLUDEDIR` + apu_inc=`$withval -q APU_INCLUDEDIR` + INCLUDES="-I$apache_inc -I$apr_inc -I$apu_inc" HTTPD_DIR=`$withval -q PREFIX` CONF_DIR=`$withval -q SYSCONFDIR` MODULES_DIR=`$withval -q LIBEXECDIR` APXS=$withval - CPPFLAGS="$CPPFLAGS -I$INCLUDE_DIR" + CPPFLAGS="$CPPFLAGS $INCLUDES" AC_MSG_RESULT(found $withval) else AC_MSG_RESULT($withval not found) withval="$withval/apxs" if test -f $withval ; then AC_MSG_RESULT(found $withval) + apache_inc=`$withval -q INCLUDEDIR` + apr_inc=`$withval -q APR_INCLUDEDIR` + apu_inc=`$withval -q APU_INCLUDEDIR` + INCLUDES="-I$apache_inc -I$apr_inc -I$apu_inc" HTTPD_DIR=`$withval -q PREFIX` CONF_DIR=`$withval -q SYSCONFDIR` MODULES_DIR=`$withval -q LIBEXECDIR` APXS=$withval - INCLUDE_DIR=`$withval -q INCLUDEDIR` - CPPFLAGS="$CPPFLAGS -I$INCLUDE_DIR" + CPPFLAGS="$CPPFLAGS $INCLUDES" else AC_MSG_ERROR($withval not found. APXS installation cannot be located!) fi fi ],) +if test "$INCLUDES" == "" ; then + AC_MSG_ERROR(could not generate includes with apxs set to "$APXS" - you must specify a valid path to apxs using the --with-apxs flag) +fi AC_CHECK_LIB(stdc++, __gxx_personality_v0, LIB_STDCPP="-lstdc++") if test "$LIB_STDCPP" == "" ; then @@ -109,7 +59,7 @@ AC_SUBST(CPLUSPLUS_BUILDDIR) AC_SUBST(MODULES_DIR) -AC_SUBST(INCLUDE_DIR) +AC_SUBST(INCLUDES) AC_SUBST(CONF_DIR) AC_SUBST(APXS) AC_SUBST(CFLAGS) |
From: Mod C. C. L. <mod...@so...> - 2004-11-27 03:36:28
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : docs Dir : mod_cplusplus/docs Modified Files: Makefile.in Log Message: ok, finally clean up the other things in the configure script and derive everything from apxs. =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/docs/Makefile.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- Makefile.in 26 Nov 2004 18:53:46 -0000 1.2 +++ Makefile.in 27 Nov 2004 03:36:18 -0000 1.3 @@ -1,2 +1,2 @@ test_handler.so: - g++ -I@CPLUSPLUS_BUILDDIR@/include -I@INCLUDE_DIR@/include -o test_handler.so -shared test_handler.cpp + g++ -I@CPLUSPLUS_BUILDDIR@/include @INCLUDES@ -o test_handler.so -shared test_handler.cpp |
From: Mod C. C. L. <mod...@so...> - 2004-11-26 18:53:54
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : docs Dir : mod_cplusplus/docs Modified Files: Makefile.in Log Message: more fixups using apxs =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/docs/Makefile.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- Makefile.in 20 Aug 2003 01:31:27 -0000 1.1 +++ Makefile.in 26 Nov 2004 18:53:46 -0000 1.2 @@ -1,2 +1,2 @@ test_handler.so: - g++ -I@CPLUSPLUS_BUILDDIR@/include -I@HTTPD_DIR@/include -o test_handler.so -shared test_handler.cpp + g++ -I@CPLUSPLUS_BUILDDIR@/include -I@INCLUDE_DIR@/include -o test_handler.so -shared test_handler.cpp |
From: Mod C. C. L. <mod...@so...> - 2004-11-26 18:53:54
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: configure.in Log Message: more fixups using apxs =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/configure.in,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- configure.in 26 Nov 2004 18:39:26 -0000 1.20 +++ configure.in 26 Nov 2004 18:53:46 -0000 1.21 @@ -75,12 +75,12 @@ AC_ARG_WITH(apxs, [ --with-apxs Specify path to apxs ], [ if test -f $withval; then - inc=`$withval -q INCLUDEDIR` + INCLUDE_DIR=`$withval -q INCLUDEDIR` HTTPD_DIR=`$withval -q PREFIX` CONF_DIR=`$withval -q SYSCONFDIR` MODULES_DIR=`$withval -q LIBEXECDIR` APXS=$withval - CPPFLAGS="$CPPFLAGS -I$inc" + CPPFLAGS="$CPPFLAGS -I$INCLUDE_DIR" AC_MSG_RESULT(found $withval) else AC_MSG_RESULT($withval not found) @@ -91,8 +91,8 @@ CONF_DIR=`$withval -q SYSCONFDIR` MODULES_DIR=`$withval -q LIBEXECDIR` APXS=$withval - inc=`$withval -q INCLUDEDIR` - CPPFLAGS="$CPPFLAGS -I$inc" + INCLUDE_DIR=`$withval -q INCLUDEDIR` + CPPFLAGS="$CPPFLAGS -I$INCLUDE_DIR" else AC_MSG_ERROR($withval not found. APXS installation cannot be located!) fi @@ -109,6 +109,7 @@ AC_SUBST(CPLUSPLUS_BUILDDIR) AC_SUBST(MODULES_DIR) +AC_SUBST(INCLUDE_DIR) AC_SUBST(CONF_DIR) AC_SUBST(APXS) AC_SUBST(CFLAGS) |
From: Mod C. C. L. <mod...@so...> - 2004-11-26 18:39:42
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : test Dir : mod_cplusplus/test Modified Files: Makefile.am Log Message: support apxs - this will definitely work right now if all include files are declared byapxs. Im not sure if there are installations where apr.h is not put in INCLUDEDIR - if there are systems like that I would have to make more changes. =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/test/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- Makefile.am 16 Aug 2003 01:34:04 -0000 1.3 +++ Makefile.am 26 Nov 2004 18:39:34 -0000 1.4 @@ -1,5 +1,5 @@ DISTFILES = t Apache-Test Makefile.am Makefile.in check: - APXS=${HTTPD_DIR}/bin/apxs; \ + APXS=${APXS}; \ export APXS; \ perl t/CPPTest |
From: Mod C. C. L. <mod...@so...> - 2004-11-26 18:39:41
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: Makefile.am configure.in Log Message: support apxs - this will definitely work right now if all include files are declared byapxs. Im not sure if there are installations where apr.h is not put in INCLUDEDIR - if there are systems like that I would have to make more changes. =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- Makefile.am 27 Aug 2004 02:58:08 -0000 1.8 +++ Makefile.am 26 Nov 2004 18:39:26 -0000 1.9 @@ -6,8 +6,8 @@ install: @echo ...installing module....... - cp src/.libs/libmod_cplusplus.@SHLIB_EXT@ @HTTPD_DIR@/modules + cp src/.libs/libmod_cplusplus.@SHLIB_EXT@ @MODULES_DIR@ @echo ...checking config file...... - if ! grep cplusplus @HTTPD_DIR@/conf/httpd.conf; then echo ...updating config file....;echo 'LoadModule cplusplus_module @HTTPD_DIR@/modules/libmod_cplusplus.@SHLIB_EXT@' >> @HTTPD_DIR@/conf/httpd.conf ; else echo ***config file already contains modcplusplus***; fi + if ! grep cplusplus @CONF_DIR@/httpd.conf; then echo ...updating config file....;echo 'LoadModule cplusplus_module @MODULES_DIR@/libmod_cplusplus.@SHLIB_EXT@' >> @CONF_DIR@/httpd.conf ; else echo ***config file already contains modcplusplus***; fi @echo ...install complete... =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/configure.in,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- configure.in 18 May 2004 02:36:39 -0000 1.19 +++ configure.in 26 Nov 2004 18:39:26 -0000 1.20 @@ -69,13 +69,37 @@ fi fi ],) + AC_MSG_RESULT(found $HTTPD_DIR) +],) +AC_MSG_CHECKING(for apxs) +AC_ARG_WITH(apxs, [ --with-apxs Specify path to apxs ], +[ + if test -f $withval; then + inc=`$withval -q INCLUDEDIR` + HTTPD_DIR=`$withval -q PREFIX` + CONF_DIR=`$withval -q SYSCONFDIR` + MODULES_DIR=`$withval -q LIBEXECDIR` + APXS=$withval + CPPFLAGS="$CPPFLAGS -I$inc" + AC_MSG_RESULT(found $withval) + else + AC_MSG_RESULT($withval not found) + withval="$withval/apxs" + if test -f $withval ; then + AC_MSG_RESULT(found $withval) + HTTPD_DIR=`$withval -q PREFIX` + CONF_DIR=`$withval -q SYSCONFDIR` + MODULES_DIR=`$withval -q LIBEXECDIR` + APXS=$withval + inc=`$withval -q INCLUDEDIR` + CPPFLAGS="$CPPFLAGS -I$inc" + else + AC_MSG_ERROR($withval not found. APXS installation cannot be located!) + fi + fi +],) -AC_MSG_RESULT(found $HTTPD_DIR) -],[ - AC_MSG_ERROR(--with-httpd not given and couldn't find a default distrobution) -]) - AC_CHECK_LIB(stdc++, __gxx_personality_v0, LIB_STDCPP="-lstdc++") if test "$LIB_STDCPP" == "" ; then CPPFLAGS="$CPPFLAGS -DNO_STDCPP" @@ -84,7 +108,9 @@ CPPFLAGS="$CPPFLAGS -g -I$CPLUSPLUS_BUILDDIR/include" AC_SUBST(CPLUSPLUS_BUILDDIR) -AC_SUBST(HTTPD_DIR) +AC_SUBST(MODULES_DIR) +AC_SUBST(CONF_DIR) +AC_SUBST(APXS) AC_SUBST(CFLAGS) AC_SUBST(LIB_STDCPP) |
From: Mod C. C. L. <mod...@so...> - 2004-08-27 13:19:43
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : include Dir : mod_cplusplus/include Modified Files: cpp_request.h Log Message: add more constification - we were returning non-const results from const methods. Submitted by Jonathan Wakely <co...@co...> =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/include/cpp_request.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- cpp_request.h 27 Aug 2004 13:08:59 -0000 1.11 +++ cpp_request.h 27 Aug 2004 13:19:36 -0000 1.12 @@ -45,11 +45,11 @@ ApacheRequestRec *next() { return mNext; } ApacheRequestRec *prev() { return mPrev; } ApacheRequestRec *main() { return mMain; } - char *the_request() const { return mRequest->the_request; } + const char *the_request() const { return mRequest->the_request; } int assbackwards() const { return mRequest->assbackwards; } int proxyreq() const { return mRequest->proxyreq; } int header_only() const { return mRequest->header_only; } - char *protocol() const {return mRequest->protocol; } + const char *protocol() const {return mRequest->protocol; } int proto_num() const { return mRequest->proto_num; } const char *hostname() const { return mRequest->hostname; } apr_time_t request_time() const { return mRequest->request_time; } @@ -58,8 +58,8 @@ const char *method() const { return mRequest->method; } int method_number() const { return mRequest->method_number; } apr_int64_t allowed() const { return mRequest->allowed; } - apr_array_header_t *allowed_xmethods() const {return mRequest->allowed_xmethods; } - ap_method_list_t *allowed_methods() const {return mRequest->allowed_methods; } + const apr_array_header_t *allowed_xmethods() const {return mRequest->allowed_xmethods; } + const ap_method_list_t *allowed_methods() const {return mRequest->allowed_methods; } apr_off_t sent_bodyct() const {return mRequest->sent_bodyct; } apr_off_t bytes_sent() const { return mRequest->bytes_sent; } apr_time_t mtime() const { return mRequest->mtime; } @@ -91,17 +91,17 @@ return ap_get_client_block(mRequest, buf, bufsiz); } - apr_array_header_t *content_languages() + const apr_array_header_t *content_languages() const { return mRequest->content_languages; } - char *vlist_validator() const { return mRequest->vlist_validator; } - char *user() const { return mRequest->user; } - char *ap_auth_type() const { return mRequest->ap_auth_type; } - char *unparsed_uri() const { return mRequest->unparsed_uri; } - char *uri() const { return mRequest->uri; } - char *filename() const { return mRequest->filename; } - char *path_info() const { return mRequest->path_info; } - char *args() const { return mRequest->args; } + const char *vlist_validator() const { return mRequest->vlist_validator; } + const char *user() const { return mRequest->user; } + const char *ap_auth_type() const { return mRequest->ap_auth_type; } + const char *unparsed_uri() const { return mRequest->unparsed_uri; } + const char *uri() const { return mRequest->uri; } + const char *filename() const { return mRequest->filename; } + const char *path_info() const { return mRequest->path_info; } + const char *args() const { return mRequest->args; } int no_cache() const { return mRequest->no_cache; } int no_local_copy() const { return mRequest->no_local_copy; } |
From: John K. S. <jo...@st...> - 2004-08-27 13:11:22
|
Hi Jon - FYI, I applied changes for your 3 suggestions: 1) change sprintf to snprintf (your other suggestions are good, but like you said probably overkill) 2) privatize the string utility methods so they're not exposed symbols 3) optimize string creation using the results of snprintf. Thanks - John On Aug 4, 2004, at 5:50 AM, Jonathan Wakely wrote: > Re-sending as I screwed it up ... > > On Sat, Jul 31, 2004 at 06:58:07AM -0700, Mod Cplusplus CVS List wrote: > >> -void ApacheRequestRec::dump() >> +// translate integer to ascii string >> +inline string >> +istring(int value, const char* format = "%d") >> +{ >> + enum { TEMP_STORE = 50 }; >> + char temp[TEMP_STORE]; >> + sprintf(temp,format,value); >> + return string(temp); >> +} > > Could a stringstream be used here instead? > It is Mod _Cplusplus_ after all. > > That avoids using fixed-length buffers and format strings, two > potential > security problems. > > The function could even be made into a template to support more than > integers, but that might be overkill. > > If using sprintf(3) is needed for portability or other reasons, how > about > the safer snprintf(3) ? Or removing the format string argument ? Does > the (unused) flexibility of supplying a format string warrant the > potential problems caused by passing in a format string that results in > more than 50 chars (buffer overrun) or passing in a string that is > incompatible with the integer argument, e.g. "%s" ? > > AFAICT that function isn't in an anonymous namespace, and has external > linkage, so could potentially be called from outside that file. IMHO > that means it should be safe against buffer overflows and format string > injection. > > Maybe I'm being too paranoid - but that's the frame of mind I like to > adopt when writing apache module code. Web servers are exposed to every > nasty person on the net and I don't think it hurts to be paranoid. > > Finally, the return value of sprintf(3) could be used to speed up > the string ctor: > > const int len = sprintf(temp,format,value); > return string(temp, len); > > regards, > > jon > > -- > "The whole problem with the world is that fools and fanatics are always > so certain of themselves, but wiser people so full of doubts." > - Bertrand Russell > > > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you noticed the changes on > Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, > one more big change to announce. We are now OSTG- Open Source > Technology > Group. Come see the changes on the new OSTG site. www.ostg.com > _______________________________________________ > Modcplusplus-devel mailing list > Mod...@li... > https://lists.sourceforge.net/lists/listinfo/modcplusplus-devel > |
From: Mod C. C. L. <mod...@so...> - 2004-08-27 13:09:07
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : include Dir : mod_cplusplus/include Modified Files: cpp_request.h Log Message: rework 3 things: 1) use snprintf instead of sprintf 2) use result from snprintf to build the string (optimization) 3) make utility methods private instance methods to protect them =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/include/cpp_request.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- cpp_request.h 31 Jul 2004 13:58:07 -0000 1.10 +++ cpp_request.h 27 Aug 2004 13:08:59 -0000 1.11 @@ -30,7 +30,9 @@ ApacheRequestRec *mNext; ApacheRequestRec *mMain; ApacheServerRec *mServer; - + /** utility functions for formatting **/ + string istring(int value, const char* format = "%d") const; + string mstring(const char *cp) const; public: ApacheRequestRec(request_rec *r, ApacheRequestRec *pPrev = NULL, ApacheRequestRec *pNext = NULL); |
From: Mod C. C. L. <mod...@so...> - 2004-08-27 13:09:07
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : src Dir : mod_cplusplus/src Modified Files: cpp_request.cpp Log Message: rework 3 things: 1) use snprintf instead of sprintf 2) use result from snprintf to build the string (optimization) 3) make utility methods private instance methods to protect them =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/src/cpp_request.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- cpp_request.cpp 31 Jul 2004 13:58:07 -0000 1.6 +++ cpp_request.cpp 27 Aug 2004 13:08:59 -0000 1.7 @@ -30,19 +30,17 @@ } // translate integer to ascii string -inline string -istring(int value, const char* format = "%d") +string ApacheRequestRec::istring(int value, const char* format) const { enum { TEMP_STORE = 50 }; char temp[TEMP_STORE]; - sprintf(temp,format,value); - return string(temp); + const int len = snprintf(temp, TEMP_STORE, format, value); + return string(temp, len); } // translate non-NULL char* to string, NULL to empty string -inline string -mstring(const char *cp) +string ApacheRequestRec::mstring(const char *cp) const { return cp ? cp : string(); } |
From: Mod C. C. L. <mod...@so...> - 2004-08-27 02:58:15
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: Makefile.am Log Message: fix install task - submitted by Dorn Hetzel <do...@he...> =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- Makefile.am 18 May 2004 02:36:39 -0000 1.7 +++ Makefile.am 27 Aug 2004 02:58:08 -0000 1.8 @@ -5,9 +5,9 @@ mod_cplusplus.dsp depcomp install: - @echo ***installing module.......*** + @echo ...installing module....... cp src/.libs/libmod_cplusplus.@SHLIB_EXT@ @HTTPD_DIR@/modules - @echo ***checking config file......*** - if ! grep cplusplus /home/www/apache-2.0/conf/httpd.conf; then echo ***updating config file....***;@echo 'LoadModule cplusplus_module @HTTPD_DIR@/modules/libmod_cplusplus.@SHLIB_EXT@' >> @HTTPD_DIR@/conf/httpd.conf ; else echo ***config file already contains modcplusplus***; fi - @echo ***install complete*** + @echo ...checking config file...... + if ! grep cplusplus @HTTPD_DIR@/conf/httpd.conf; then echo ...updating config file....;echo 'LoadModule cplusplus_module @HTTPD_DIR@/modules/libmod_cplusplus.@SHLIB_EXT@' >> @HTTPD_DIR@/conf/httpd.conf ; else echo ***config file already contains modcplusplus***; fi + @echo ...install complete... |
From: Jonathan W. <co...@co...> - 2004-08-05 09:59:09
|
On Wed, Aug 04, 2004 at 03:33:21PM +0100, Jonathan Wakely wrote: > Hi again, > > Looking at that commit again, I'm not sure the const-correctness fixes > are right. > e.g. > - char *the_request() { return mRequest->the_request; } > + char *the_request() const { return mRequest->the_request; } > > This allows the following to compile, but the assertion will fail: > > void f(ApacheRequestRec const& r) // N.B. const > { > const std::string the_orig_request( r.the_request() ); > > r.the_request()[0] = '\0'; > > assert( the_request == r.the_request() ); // ^^^^^^^^^^^ this should be: assert( the_orig_request == r.the_request() ); // ^^^^^^^^^^^^^^^^ > } Sorry for any confusion. jon -- "Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians." - Edsger Dijkstra |
From: Jonathan W. <co...@co...> - 2004-08-04 14:33:24
|
Hi again, Looking at that commit again, I'm not sure the const-correctness fixes are right. e.g. - char *the_request() { return mRequest->the_request; } + char *the_request() const { return mRequest->the_request; } This allows the following to compile, but the assertion will fail: void f(ApacheRequestRec const& r) // N.B. const { const std::string the_orig_request( r.the_request() ); r.the_request()[0] = '\0'; assert( the_request == r.the_request() ); } Returning char* (as opposed to const char*) from a const method allows the caller to modify the underlying string. This might be surprising considering you access the string through a const reference. The const qualifier on a member function implies that no observable property of the object will be affected by calling the member. The function above shows that is not true for ApacheRequestRec. Care must be taken when returning pointers from const methods. The member pointer will be const in the context of a const method, but the pointee is not const and is modifiable. It might be better to leave the_request() non-const and add a const overload that returns const char*, so the underlying request_rec struct and the strings it contains cannot be modified through a const ApacheRequestRec. i.e. revert the previous change and add this new member: const char *the_request() const { return mRequest->the_request; } Then again, as I've not used the ApacheRequestRec class I don't know if I'm talking complete rubbish. It might make perfect sense to allow the request_rec's data to be modified on a const object. jon -- "He who joyfully marches to music in rank and file has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would fully suffice." - Albert Einstein |
From: Jonathan W. <co...@co...> - 2004-08-04 14:15:58
|
On Wed, Aug 04, 2004 at 10:05:49AM -0400, John K. Sterling wrote: > I'll have these on the todo list, but if you feel like sending patches > over I'll be happy to review and commit (and give you credit, of > course). I keep meaning to have a proper look at mod cplusplus, I've never used it as all the work I do with apache is stuck on v1.3, so we have our own local patches to allow modules to be written in C++. I am subscribed to the list though, so look at the cvs commits now and then, hence this impromptu review :) If I ever get a chance to properly look at it (or even better, use it!) I'll share any ideas I have. regards, jon -- "Break your own rules" |
From: John K. S. <jo...@st...> - 2004-08-04 14:14:00
|
Ack offline thread/patch submit: Begin forwarded message: > From: "William F. Dowling" <wil...@th...> > Date: July 27, 2004 10:58:32 AM EDT > To: "John K. Sterling" <jo...@st...> > Subject: Re: mod_cplusplus memory leaks > Reply-To: wil...@th... > X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no > version=2.63 > > Hi John, > > I am including as attachments modified versions of cpp_request.{cpp,h}. > I would like you to consider using these mods in your next release (or > merging them into your CVS tree.) The changes are: > > Add public method > std::string ApacheRequestRec::dump_string() const > This method simply returns as a string what was produced by a call to > ApacheRequestRec::dump(), which routine is refactored to call > dump_string(). This adds flexibility to logging. A couple small > private helper rountines were added to support that change. > > Make several methods const. This has no effect internally, but helps > with callers that are trying to be "const-correct". > > Remove trailing whitespace on a few lines. > > The changes compile for me under Linux and Solaris, and all tests are > passing. > > I hope you don't mind my using std::string. In my opinion it is far > superior to char*, and it seems a reasonable goal for mod_cplusplus to > be more C++-like rather than straight C (otherwise why not write > directly to the C API and bypass mod_cplusplus altogether.) > > Let me know what you think, > > Thanks, > > Will > > > On Fri, 2004-06-25 at 17:22, John K. Sterling wrote: >> Wow - >> >> very cool. looks like a legitimate leak. nice catch. I'm definitely >> going to try that out, i've never used it - I've used tools like >> purify >> before... but they are very expensive. >> >> I have some time this weekend - I'll at least fix that problem, and >> try to >> pull down valgrind and run the tests against it. >> >> Thanks for all your input - >> >> John > > -- > William F. Dowling > Thomson/ISI (www.isinet.com) > 215-386-0100 x-1156 > > > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit http://www.messagelabs.com/email > ______________________________________________________________________# > ifndef CPP_REQUEST_H > #define CPP_REQUEST_H > > #ifdef WIN32 > #pragma warning( disable : 4275 4273 4786 ) > #ifdef EXPORT_MODCPP > #define MODCPP_API __declspec(dllexport) > #else > #define MODCPP_API __declspec(dllimport) > #endif /* EXPORT_MODCPP */ > #else > #define MODCPP_API > #endif /* WIN32 */ > > #include <httpd.h> > #include <http_request.h> > #include <http_config.h> > #include <http_core.h> > #include <http_protocol.h> > #include <apr_strings.h> > #include <string> > #include "cpp_server.h" > > class MODCPP_API ApacheRequestRec > { > private: > std::string ApacheRequestRec::table_string(const apr_table_t > *pTable) const; > > request_rec *mRequest; > ApacheRequestRec *mPrev; > ApacheRequestRec *mNext; > ApacheRequestRec *mMain; > ApacheServerRec *mServer; > > public: > ApacheRequestRec(request_rec *r, ApacheRequestRec *pPrev = NULL, > ApacheRequestRec *pNext = NULL); > ~ApacheRequestRec(); > > apr_pool_t *pool() const { return mRequest->pool; } > conn_rec *connection() const { return mRequest->connection; } > > ApacheServerRec *server() const { return mServer; } > ApacheRequestRec *next() const { return mNext; } > ApacheRequestRec *prev() const { return mPrev; } > ApacheRequestRec *main() const { return mMain; } > char *the_request() const { return mRequest->the_request; } > int assbackwards() const { return mRequest->assbackwards; } > int proxyreq() const { return mRequest->proxyreq; } > int header_only() const { return mRequest->header_only; } > char *protocol() const {return mRequest->protocol; } > int proto_num() const { return mRequest->proto_num; } > const char *hostname() const { return mRequest->hostname; } > apr_time_t request_time() const { return mRequest->request_time; } > const char *status_line() const { return mRequest->status_line; } > int status() const {return mRequest->status; } > const char *method() const { return mRequest->method; } > int method_number() const { return mRequest->method_number; } > apr_int64_t allowed() const { return mRequest->allowed; } > apr_array_header_t *allowed_xmethods() const {return > mRequest->allowed_xmethods; } > ap_method_list_t *allowed_methods() const {return > mRequest->allowed_methods; } > apr_off_t sent_bodyct() const {return mRequest->sent_bodyct; } > apr_off_t bytes_sent() const { return mRequest->bytes_sent; } > apr_time_t mtime() const { return mRequest->mtime; } > int chunked() const { return mRequest->chunked; } > /* const char *boundary() const {return mRequest->boundary; } */ > const char *range() const {return mRequest->range; } > apr_off_t clength() const {return mRequest->clength; } > apr_off_t remaining() const {return mRequest->remaining; } > apr_off_t read_length() const { return mRequest->read_length; } > int read_body() const { return mRequest->read_body; } > int read_chunked() const { return mRequest->read_chunked; } > > apr_table_t *headers_in() const { return mRequest->headers_in; } > apr_table_t *headers_out() const { return mRequest->headers_out; } > apr_table_t *err_headers_out() const { return > mRequest->err_headers_out; } > apr_table_t *subprocess_env() const { return > mRequest->subprocess_env; } > apr_table_t *notes() const { return mRequest->notes; } > > const char *content_type(char *type = NULL) const > { return type ? (mRequest->content_type = > apr_pstrdup(mRequest->pool, type)) : > mRequest->content_type; } > const char *handler() const { return mRequest->handler; } > const char *content_encoding() const { return > mRequest->content_encoding; } > int discard_request_body() { > return ap_discard_request_body(mRequest); > } > > int get_client_block(char *buf, apr_size_t bufsiz) { > return ap_get_client_block(mRequest, buf, bufsiz); > } > > apr_array_header_t *content_languages() > { return mRequest->content_languages; } > > char *vlist_validator() const { return mRequest->vlist_validator; } > char *user() const { return mRequest->user; } > char *ap_auth_type() const { return mRequest->ap_auth_type; } > char *unparsed_uri() const { return mRequest->unparsed_uri; } > char *uri() const { return mRequest->uri; } > char *filename() const { return mRequest->filename; } > char *path_info() const { return mRequest->path_info; } > char *args() const { return mRequest->args; } > > int no_cache() const { return mRequest->no_cache; } > int no_local_copy() const { return mRequest->no_local_copy; } > > apr_finfo_t finfo() const { return mRequest->finfo; } > apr_uri_t parsed_uri() const { return mRequest->parsed_uri; } > > void *get_dir_config(module *m); > void *get_server_config(module *m); > > int get_basic_auth_pw(const char **sent_pw); > int rputc(int c); > int rputs(const char *str) const; > int rwrite(const void *buf, int nbyte); > int rprintf(const char *fmt, ...); > int rflush(); > > int allow_options() { return ap_allow_options(mRequest); } > int allow_overrides(){ return ap_allow_overrides(mRequest); } > const char *default_type() { return ap_default_type(mRequest); } > const char *document_root() { return ap_document_root(mRequest); } > const char *get_remote_logname() { return > ap_get_remote_logname(mRequest); } > const char *get_server_name() { return > ap_get_server_name(mRequest); } > void custom_response(int status, const char *str) > { ap_custom_response(mRequest, status, (char *)str); } > > void internal_redirect(const char *new_uri) > { ap_internal_redirect(new_uri, mRequest); } > > void internal_redirect_handler(const char *new_uri) > { ap_internal_redirect(new_uri, mRequest); } > > int some_auth_required() > { return ap_some_auth_required(mRequest); } > > int is_initial_req() > { return ap_is_initial_req(mRequest); } > > void update_mtime(apr_time_t dependency_mtime) > { ap_update_mtime(mRequest, dependency_mtime); } > > void allow_methods(int reset, ...); > > void dump() const; > void dump_table(const apr_table_t *pTable) const; > std::string dump_string() const; > request_rec *get_request_rec() { return mRequest; } > }; > > #endif /* CPP_REQUEST_H */ |