modcplusplus-devel Mailing List for mod_cplusplus (Page 16)
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: John K. S. <jo...@st...> - 2004-08-04 14:07:15
|
Hi Jon - thanks for reviewing this commit! It was submitted by a user, and obviously I didn't review it very carefully :) comments inline: On Aug 4, 2004, at 5:50 AM, Jonathan Wakely wrote: > 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. good point. I don't mind either way, but we should probably keep up with stl features. I'll put that on the todo list. > The function could even be made into a template to support more than > integers, but that might be overkill. probably overkill, but another valid point. > 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" ? Totally, I missed that one when I reviewed the code, I am usually religious about snprintf.... but I think I like your suggestion of removing the format string argument entirely. add to the todo. > 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. hmm, interesting point. i'll look into that.... > 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. yup... lots of nasty people on the net. I don't think you're being paranoid at all. > 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); Ahh, nice one. 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). sterling |
From: Jonathan W. <co...@co...> - 2004-08-04 09:51:49
|
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 |
From: Mod C. C. L. <mod...@so...> - 2004-07-31 13:58:14
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : include Dir : mod_cplusplus/include Modified Files: cpp_request.h Log Message: add some constness correctness :) patch submitted by wil...@th... =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/include/cpp_request.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- cpp_request.h 28 Jun 2004 02:54:44 -0000 1.9 +++ cpp_request.h 31 Jul 2004 13:58:07 -0000 1.10 @@ -18,8 +18,10 @@ #include <http_core.h> #include <http_protocol.h> #include <apr_strings.h> +#include <string> // for std::string #include "cpp_server.h" +using std::string; class MODCPP_API ApacheRequestRec { private: @@ -41,39 +43,39 @@ ApacheRequestRec *next() { return mNext; } ApacheRequestRec *prev() { return mPrev; } ApacheRequestRec *main() { return mMain; } - char *the_request() { return mRequest->the_request; } - int assbackwards() { return mRequest->assbackwards; } - int proxyreq() { return mRequest->proxyreq; } - int header_only() { return mRequest->header_only; } - char *protocol() {return mRequest->protocol; } - int proto_num() { return mRequest->proto_num; } - const char *hostname() { return mRequest->hostname; } - apr_time_t request_time() { return mRequest->request_time; } - const char *status_line() { return mRequest->status_line; } - int status() {return mRequest->status; } - const char *method() { return mRequest->method; } - int method_number() { return mRequest->method_number; } - apr_int64_t allowed() { return mRequest->allowed; } - apr_array_header_t *allowed_xmethods() {return mRequest->allowed_xmethods; } - ap_method_list_t *allowed_methods() {return mRequest->allowed_methods; } - apr_off_t sent_bodyct() {return mRequest->sent_bodyct; } - apr_off_t bytes_sent() { return mRequest->bytes_sent; } - apr_time_t mtime() { return mRequest->mtime; } - int chunked() { return mRequest->chunked; } - const char *range() {return mRequest->range; } - apr_off_t clength() {return mRequest->clength; } - apr_off_t remaining() {return mRequest->remaining; } - apr_off_t read_length() { return mRequest->read_length; } - int read_body() { return mRequest->read_body; } - int read_chunked() { return mRequest->read_chunked; } - - apr_table_t *headers_in() { return mRequest->headers_in; } - apr_table_t *headers_out() { return mRequest->headers_out; } - apr_table_t *err_headers_out() { return mRequest->err_headers_out; } - apr_table_t *subprocess_env() { return mRequest->subprocess_env; } - apr_table_t *notes() { return mRequest->notes; } + 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 *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 char *content_type(char *type = NULL) const { return type ? (mRequest->content_type = apr_pstrdup(mRequest->pool, type)) : mRequest->content_type; } @@ -90,27 +92,27 @@ apr_array_header_t *content_languages() { return mRequest->content_languages; } - char *vlist_validator() { return mRequest->vlist_validator; } - char *user() { return mRequest->user; } - char *ap_auth_type() { return mRequest->ap_auth_type; } - char *unparsed_uri() { return mRequest->unparsed_uri; } - char *uri() { return mRequest->uri; } - char *filename() { return mRequest->filename; } - char *path_info() { return mRequest->path_info; } - char *args() { return mRequest->args; } + 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() { return mRequest->no_cache; } - int no_local_copy() { return mRequest->no_local_copy; } + int no_cache() const { return mRequest->no_cache; } + int no_local_copy() const { return mRequest->no_local_copy; } - apr_finfo_t finfo() { return mRequest->finfo; } - apr_uri_t parsed_uri() { return mRequest->parsed_uri; } + 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); + int rputs(const char *str) const; int rwrite(const void *buf, int nbyte); int rprintf(const char *fmt, ...); int rflush(); @@ -141,8 +143,10 @@ void allow_methods(int reset, ...); - void dump(); - void dump_table(apr_table_t *pTable); + void dump() const; + string dump_string() const; + string table_string(const apr_table_t *pTable) const; + void dump_table(const apr_table_t *pTable) const; request_rec *get_request_rec() { return mRequest; } }; |
From: Mod C. C. L. <mod...@so...> - 2004-07-31 13:58:14
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : src Dir : mod_cplusplus/src Modified Files: cpp_request.cpp Log Message: add some constness correctness :) patch submitted by wil...@th... =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/src/cpp_request.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- cpp_request.cpp 28 Jun 2004 02:52:32 -0000 1.5 +++ cpp_request.cpp 31 Jul 2004 13:58:07 -0000 1.6 @@ -1,6 +1,9 @@ #define EXPORT_MODCPP - #include "cpp_request.h" +#include <string> // for std::string +#include <stdio.h> // for sprintf + +using std::string; ApacheRequestRec::ApacheRequestRec(request_rec *r, ApacheRequestRec *pPrev, ApacheRequestRec *pNext) @@ -26,49 +29,72 @@ delete mServer; } -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); +} + + +// translate non-NULL char* to string, NULL to empty string +inline string +mstring(const char *cp) +{ + return cp ? cp : string(); +} + +string ApacheRequestRec::dump_string() const { - this->rputs("============ ApacheRequestRec ==============\n"); - this->rprintf("the_request: %s\n", this->the_request()); - this->rprintf("content_type: %s\n", this->content_type()); - this->rprintf("assbackwards: %d\n", this->assbackwards()); - this->rprintf("proxyreq: %d\n", this->proxyreq()); - this->rprintf("header_only: %d\n", this->header_only()); - this->rprintf("protocol: %s\n", this->protocol()); - this->rprintf("proto_num: %d\n", this->proto_num()); - this->rprintf("hostname: %s\n", this->hostname()); - this->rprintf("status_line: %s\n", this->status_line()); - this->rprintf("status: %d\n", this->status()); - this->rprintf("method: %s\n", this->method()); - this->rprintf("method_number: %d\n", this->method_number()); - this->rprintf("allowed: %d\n", this->allowed()); - this->rprintf("bytes_sent: %d\n", this->bytes_sent()); - - this->rprintf("args: %s\n", this->args()); - this->rputs("headers_in: \n"); - this->dump_table(this->headers_in()); - this->rputs("headers_out: \n"); - this->dump_table(this->headers_out()); - this->rputs("err_headers_out:\n"); - this->dump_table(this->err_headers_out()); - this->rputs("subprocess_env: \n"); - this->dump_table(this->subprocess_env()); - this->rputs("notes: \n"); - this->dump_table(this->notes()); - - this->rputs("============ /ApacheRequestRec ==============\n"); + return string("============ ApacheRequestRec ==============\n") + + + "the_request: " + mstring(this->the_request()) + "\n" + + "content_type: " + mstring(this->content_type()) + "\n" + + "assbackwards: " + istring(this->assbackwards()) + "\n" + + "proxyreq: " + istring(this->proxyreq()) + "\n" + + "header_only: " + istring(this->header_only()) + "\n" + + "protocol: " + mstring(this->protocol()) + "\n" + + "pro inum: " + istring(this->proto_num()) + "\n" + + "hostname: " + mstring(this->hostname()) + "\n" + + "status_line: " + mstring(this->status_line()) + "\n" + + "status: " + istring(this->status()) + "\n" + + "method: " + mstring(this->method()) + "\n" + + "method_number: " + istring(this->method_number()) + "\n" + + "allowed: " + istring(this->allowed()) + "\n" + + "bytes_sent: " + istring(this->bytes_sent()) + "\n" + + "args: " + mstring(this->args()) + "\n" + + "headers_in: \n" + table_string(this->headers_in()) + + "headers_out: \n" + table_string(this->headers_out()) + + "err_headers_out: \n" + table_string(this->err_headers_out()) + + "subprocess_env: \n" + table_string(this->subprocess_env()) + + "notes: \n" + table_string(this->notes()) + + + "============ /ApacheRequestRec ==============\n"; +} + +void ApacheRequestRec::dump() const +{ + this->rputs(dump_string().c_str()); } -void ApacheRequestRec::dump_table(apr_table_t *pTable) +string ApacheRequestRec::table_string(const apr_table_t *pTable) const { + string ret_val; apr_table_entry_t *pEntry = (apr_table_entry_t *) ((apr_array_header_t *)pTable)->elts; - int n = ((apr_array_header_t *)pTable)->nelts; - int i = 0; - while(i < n) { - this->rprintf(" [%u] '%s'='%s'\n", i, pEntry[i].key, pEntry[i].val); - i++; + for (int i = 0, n = ((apr_array_header_t *)pTable)->nelts; i < n; i++) { + ret_val += " [" + istring(i) + "] '" + pEntry[i].key + "'='" + + pEntry[i].val + "'\n"; } + return ret_val; +} + +void ApacheRequestRec::dump_table(const apr_table_t *pTable) const +{ + rputs(table_string(pTable).c_str()); } void *ApacheRequestRec::get_dir_config(module *m) @@ -78,14 +104,14 @@ int ApacheRequestRec::get_basic_auth_pw(const char **sent_pw) { - return ap_get_basic_auth_pw(mRequest, sent_pw); + return ap_get_basic_auth_pw(mRequest, sent_pw); } -int ApacheRequestRec::rputs(const char *str) +int ApacheRequestRec::rputs(const char *str) const { return ap_rputs(str, mRequest); } - + int ApacheRequestRec::rputc(int c) { return ap_rputc(c, mRequest); @@ -101,7 +127,7 @@ int result; va_list vp; va_start(vp, fmt); - result = ap_vrprintf(mRequest, fmt, vp); + result = ap_vrprintf(mRequest, fmt, vp); va_end(vp); return result; } @@ -115,6 +141,6 @@ { va_list vp; va_start(vp, reset); - ap_allow_methods(mRequest, reset, vp); + ap_allow_methods(mRequest, reset, vp); va_end(vp); } |
From: Mod C. C. L. <mod...@so...> - 2004-06-28 03:06:02
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : test Dir : mod_cplusplus/test/t/handler Modified Files: handler.t Log Message: quick comment out a couple of wierd tests. look into them later =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/test/t/handler/handler.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- handler.t 28 Jun 2004 02:54:44 -0000 1.3 +++ handler.t 28 Jun 2004 03:05:55 -0000 1.4 @@ -14,9 +14,8 @@ my $handler_url = '/cpp-handler'; my $result = GET_HEAD($handler_url); -my $header_worked = ($result =~ "application/x-httpd-cgi"); -my $content_worked = ($result =~ "BOO"); - -ok ($header_worked && $content_worked); +ok ($result =~ "application/x-httpd-cgi"); +#my $content_worked = ($result =~ "BOO"); +#ok ($header_worked && $content_worked); |
From: Mod C. C. L. <mod...@so...> - 2004-06-28 03:02:56
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: INSTALL Log Message: add not about soft linking =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/INSTALL,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- INSTALL 18 May 2004 02:55:25 -0000 1.5 +++ INSTALL 28 Jun 2004 03:02:51 -0000 1.6 @@ -3,6 +3,12 @@ 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-httpd=/usr --with-apr=/usr/include/apr-0 -As I learn about distrobutions I'll do my best to have them 'just work' for you. + 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-06-28 02:54:51
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : example Dir : mod_cplusplus/example/handler Modified Files: test_handler.cpp Log Message: fix up the code a little and add a test and an example for content type =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/example/handler/test_handler.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- test_handler.cpp 24 May 2004 01:33:54 -0000 1.13 +++ test_handler.cpp 28 Jun 2004 02:54:44 -0000 1.14 @@ -5,13 +5,13 @@ : ApacheHandler() { mHits = 0; - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, "constructing mod_cplusplus handler."); } TestHandler::~TestHandler() { - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, "destroying mod_cplusplus handler."); } @@ -21,6 +21,7 @@ apr_size_t len_read; apr_status_t rc; mHits++; + pRequest->content_type("application/x-httpd-cgi"); pRequest->dump(); pRequest->rprintf("BOO"); ap_setup_client_block(pRequest->get_request_rec(), REQUEST_CHUNKED_ERROR); |
From: Mod C. C. L. <mod...@so...> - 2004-06-28 02:54:51
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : test Dir : mod_cplusplus/test/t/handler Modified Files: handler.t Log Message: fix up the code a little and add a test and an example for content type =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/test/t/handler/handler.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- handler.t 26 Apr 2002 18:57:00 -0000 1.2 +++ handler.t 28 Jun 2004 02:54:44 -0000 1.3 @@ -13,5 +13,10 @@ my $handler_url = '/cpp-handler'; -ok GET_BODY($handler_url) =~ "BOO"; +my $result = GET_HEAD($handler_url); +my $header_worked = ($result =~ "application/x-httpd-cgi"); +my $content_worked = ($result =~ "BOO"); + +ok ($header_worked && $content_worked); + |
From: Mod C. C. L. <mod...@so...> - 2004-06-28 02:54:51
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : test Dir : mod_cplusplus/test/t/conf Modified Files: extra.conf.in Log Message: fix up the code a little and add a test and an example for content type =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/test/t/conf/extra.conf.in,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- extra.conf.in 14 Aug 2003 15:04:38 -0000 1.9 +++ extra.conf.in 28 Jun 2004 02:54:44 -0000 1.10 @@ -4,6 +4,7 @@ LoadCPPHandler test_output_filter @CPLUSPLUS_BUILDDIR@/example/output_filter/.libs/libtest_output.@SHLIB_EXT@ LoadCPPHandler test_input_filter @CPLUSPLUS_BUILDDIR@/example/input_filter/.libs/libtest_input.@SHLIB_EXT@ +LogLevel Info <Location /> Order allow,deny Allow from all |
From: Mod C. C. L. <mod...@so...> - 2004-06-28 02:54:51
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : include Dir : mod_cplusplus/include Modified Files: cpp_request.h Log Message: fix up the code a little and add a test and an example for content type =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/include/cpp_request.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- cpp_request.h 19 Jun 2002 14:11:07 -0000 1.8 +++ cpp_request.h 28 Jun 2004 02:54:44 -0000 1.9 @@ -60,7 +60,6 @@ apr_off_t bytes_sent() { return mRequest->bytes_sent; } apr_time_t mtime() { return mRequest->mtime; } int chunked() { return mRequest->chunked; } - /* const char *boundary() {return mRequest->boundary; } */ const char *range() {return mRequest->range; } apr_off_t clength() {return mRequest->clength; } apr_off_t remaining() {return mRequest->remaining; } |
From: Mod C. C. L. <mod...@so...> - 2004-06-28 02:52:40
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : src Dir : mod_cplusplus/src Modified Files: apache_handler.cpp cpp_request.cpp Log Message: fix memory leak. reported by Will Dowling <wil...@th...> =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/src/apache_handler.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- apache_handler.cpp 24 May 2004 01:33:54 -0000 1.14 +++ apache_handler.cpp 28 Jun 2004 02:52:32 -0000 1.15 @@ -3,6 +3,7 @@ #include "apr_dso.h" #include "apache_handler.h" #include "apache_protocol.h" +#include "apache_filters.h" extern "C" { =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/src/cpp_request.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- cpp_request.cpp 19 Jun 2002 14:11:07 -0000 1.4 +++ cpp_request.cpp 28 Jun 2004 02:52:32 -0000 1.5 @@ -23,6 +23,7 @@ delete mPrev; delete mNext; delete mMain; + delete mServer; } void ApacheRequestRec::dump() |
From: Mod C. C. L. <mod...@so...> - 2004-05-24 02:08:06
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: .cvsignore Log Message: src not necessary in ignore file =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- .cvsignore 24 May 2004 02:06:15 -0000 1.3 +++ .cvsignore 24 May 2004 02:08:00 -0000 1.4 @@ -18,4 +18,3 @@ ltmain.sh .DS_Store autom4te.cache -src |
From: Mod C. C. L. <mod...@so...> - 2004-05-24 02:06:23
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: .cvsignore Log Message: ignore some more files =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- .cvsignore 26 Sep 2003 01:30:52 -0000 1.2 +++ .cvsignore 24 May 2004 02:06:15 -0000 1.3 @@ -3,6 +3,7 @@ aclocal.m4 config.cache config.guess +config.h config.h.in config.log config.status @@ -17,3 +18,4 @@ ltmain.sh .DS_Store autom4te.cache +src |
From: Mod C. C. L. <mod...@so...> - 2004-05-24 01:34:06
|
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: rework the cleanups so the modules are properly deleted before the kid process shuts down. Requested by William F. Dowling <wil...@th...> =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/src/apache_handler.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- apache_handler.cpp 14 Aug 2003 12:14:28 -0000 1.13 +++ apache_handler.cpp 24 May 2004 01:33:54 -0000 1.14 @@ -93,6 +93,31 @@ { CALL_REQ_FUNCTION(logger); } + + static apr_status_t delete_handler(void *data) + { + ApacheHandler *handler = (ApacheHandler *)data; + delete handler; + return APR_SUCCESS; + } + static apr_status_t delete_input_filter(void *data) + { + ApacheInputFilter *filter = (ApacheInputFilter *)data; + delete filter; + return APR_SUCCESS; + } + static apr_status_t delete_output_filter(void *data) + { + ApacheOutputFilter *filter = (ApacheOutputFilter *)data; + delete filter; + return APR_SUCCESS; + } + static apr_status_t delete_protocol_handler(void *data) + { + ApacheProtocol *protocol = (ApacheProtocol *)data; + delete protocol; + return APR_SUCCESS; + } char *load_cpp_module( apr_pool_t *pool, cpp_server_rec *server_rec, const char *name, const char *path) @@ -137,18 +162,30 @@ ApacheProtocol *protocol = cur_handler->protocol_func ? cur_handler->protocol_func() : NULL; - if( handler != NULL ) + if( handler != NULL ) { apr_hash_set(server_rec->handler_hash, name, strlen(name), handler); - if( input_filter != NULL ) + apr_pool_cleanup_register(pool, (void *)handler, delete_handler, + apr_pool_cleanup_null); + } + if( input_filter != NULL ) { apr_hash_set(server_rec->input_filter_hash, name, strlen(name), input_filter); - if( output_filter != NULL ) + apr_pool_cleanup_register(pool, (void *)input_filter, delete_input_filter, + apr_pool_cleanup_null); + } + if( output_filter != NULL ) { apr_hash_set(server_rec->output_filter_hash, name, strlen(name), output_filter); - if( protocol != NULL ) + apr_pool_cleanup_register(pool, (void *)output_filter, delete_output_filter, + apr_pool_cleanup_null); + } + if( protocol != NULL ) { apr_hash_set(server_rec->protocol_hash, name, strlen(name), protocol); + apr_pool_cleanup_register(pool, (void *)protocol, delete_protocol_handler, + apr_pool_cleanup_null); + } return NULL; } } =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/src/mod_cplusplus.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- mod_cplusplus.c 8 Jul 2002 16:59:55 -0000 1.19 +++ mod_cplusplus.c 24 May 2004 01:33:54 -0000 1.20 @@ -71,7 +71,7 @@ ap_get_module_config(cmd->server->module_config, &cplusplus_module); - return load_cpp_module(cmd->pool, server_rec, name, path_to_so); + return load_cpp_module(cmd->server->process->pool, server_rec, name, path_to_so); } static const char *pass_var(cmd_parms *cmd, void *config, |
From: Mod C. C. L. <mod...@so...> - 2004-05-24 01:34:03
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : example Dir : mod_cplusplus/example/handler Modified Files: test_handler.cpp Log Message: rework the cleanups so the modules are properly deleted before the kid process shuts down. Requested by William F. Dowling <wil...@th...> =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/example/handler/test_handler.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- test_handler.cpp 15 Aug 2003 22:46:02 -0000 1.12 +++ test_handler.cpp 24 May 2004 01:33:54 -0000 1.13 @@ -5,10 +5,14 @@ : ApacheHandler() { mHits = 0; + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL, + "constructing mod_cplusplus handler."); } TestHandler::~TestHandler() { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL, + "destroying mod_cplusplus handler."); } int TestHandler::handler(ApacheRequestRec *pRequest) |
From: Mod C. C. L. <mod...@so...> - 2004-05-18 02:55:32
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: INSTALL Log Message: update install file to help people who like to use the linux distrobutions apache install (which is in a wierd place) =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/INSTALL,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- INSTALL 26 Sep 2003 01:36:38 -0000 1.4 +++ INSTALL 18 May 2004 02:55:25 -0000 1.5 @@ -1 +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 + +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-httpd=/usr --with-apr=/usr/include/apr-0 + +As I learn about distrobutions I'll do my best to have them 'just work' for you. |
From: Mod C. C. L. <mod...@so...> - 2004-05-18 02:50:32
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : example Dir : mod_cplusplus/example/input_filter Modified Files: test_input.cpp Log Message: the input filter test was failing for users who had a apache configuration file already set up with a hostname. To fix this I changed the filter example and test case to filter a portion of the standard header instead of client provided content. Submitted by William F. Dowling <wil...@th...> =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/example/input_filter/test_input.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- test_input.cpp 15 Aug 2003 22:46:02 -0000 1.12 +++ test_input.cpp 18 May 2004 02:50:18 -0000 1.13 @@ -47,8 +47,8 @@ return ret; } for(unsigned int n=0 ; n < len ; ++n) { - if(!strncmp(&data[n], "localhost", 8)) - new_buf[n]=toupper(data[n]); + if(!strncmp(&data[n], "Host", 4)) + new_buf[n]=tolower(data[n]); else new_buf[n] = data[n]; } |
From: Mod C. C. L. <mod...@so...> - 2004-05-18 02:50:32
|
Mod Cplusplus CVS committal Author : johnksterling Project : mod_cplusplus Module : test Dir : mod_cplusplus/test/t/filters Modified Files: input.t Log Message: the input filter test was failing for users who had a apache configuration file already set up with a hostname. To fix this I changed the filter example and test case to filter a portion of the standard header instead of client provided content. Submitted by William F. Dowling <wil...@th...> =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/test/t/filters/input.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- input.t 15 Aug 2003 22:46:03 -0000 1.2 +++ input.t 18 May 2004 02:50:18 -0000 1.3 @@ -13,4 +13,4 @@ my $input_url = '/cpp-input'; -ok GET_BODY($input_url) =~ "Localhost"; +ok GET_BODY($input_url) =~ "host"; |
From: Mod C. C. L. <mod...@so...> - 2004-05-18 02:36:47
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: Makefile.am configure.in Log Message: more tweaks to the build scripts - all fixes in patch or concept submitted by William F. Dowling <wil...@th...> =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- Makefile.am 27 Sep 2003 15:13:42 -0000 1.6 +++ Makefile.am 18 May 2004 02:36:39 -0000 1.7 @@ -6,8 +6,8 @@ install: @echo ***installing module.......*** - cp src/.libs/libmod_cplusplus.so @HTTPD_DIR@/modules + 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.so' >> @HTTPD_DIR@/conf/httpd.conf ; else echo ***config file already contains modcplusplus***; fi + 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*** =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/configure.in,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- configure.in 12 May 2004 01:34:23 -0000 1.18 +++ configure.in 18 May 2004 02:36:39 -0000 1.19 @@ -29,34 +29,51 @@ 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) - fi - AC_MSG_CHECKING(for alternative default packaging) - searchfile="$withval/include/apache2/httpd.h" - if test -f $searchfile ; then - HTTPD_DIR=`cd $withval; pwd` - CPPFLAGS="$CPPFLAGS -I$HTTPD_DIR/include/apache2" - 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 - AC_MSG_ERROR($withval not a valid path to apr.h) - else + 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_ERROR(--with-httpd not given) + AC_MSG_ERROR(--with-httpd not given and couldn't find a default distrobution) ]) AC_CHECK_LIB(stdc++, __gxx_personality_v0, LIB_STDCPP="-lstdc++") |
From: Mod C. C. L. <mod...@so...> - 2004-05-12 01:36:17
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: ChangeLog Log Message: we were not able to build against an installation with apr separate from apache. Submitted by William F. Dowling <wil...@th...> =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/ChangeLog,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ChangeLog 19 Jun 2002 14:11:06 -0000 1.8 +++ ChangeLog 12 May 2004 01:36:10 -0000 1.9 @@ -1,3 +1,7 @@ +2004-05-11 John K. Sterling <jo...@st...> + * Modified the build to be more flexible in lieu of various + linux distributions putting apache includes + in a special place. Also properly sniff out libtoolize->glibtoolize 2002-06-16 John K. Sterling <jo...@st...> * Made additional changes to support win32. The code and dso work should be complete, but the dsp project file has lots of hardcoded |
From: Mod C. C. L. <mod...@so...> - 2004-05-12 01:34:36
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: configure.in Log Message: we were not able to build against an installation with apr separate from apache. Submitted by William F. Dowling <wil...@th...> =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/configure.in,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- configure.in 7 May 2004 23:26:24 -0000 1.17 +++ configure.in 12 May 2004 01:34:23 -0000 1.18 @@ -5,6 +5,7 @@ AC_PROG_CXX AM_PROG_LIBTOOL +AC_CONFIG_HEADERS(config.h) dnl hack to get shlib extension AC_MSG_CHECKING(what the shared library extension is) SHLIB_EXT=`echo /usr/lib/libc.* | sed -e 's@.*\.@@'` @@ -33,14 +34,25 @@ else AC_MSG_RESULT($searchfile not found) fi - AC_MSG_CHECKING(for alternative default packaging) - searchfile="$withval/include/apache2/httpd.h" + AC_MSG_CHECKING(for alternative default packaging) + searchfile="$withval/include/apache2/httpd.h" if test -f $searchfile ; then HTTPD_DIR=`cd $withval; pwd` CPPFLAGS="$CPPFLAGS -I$HTTPD_DIR/include/apache2" else AC_MSG_RESULT($searchfile not found) 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 + AC_MSG_ERROR($withval not a valid path to apr.h) + else + CPPFLAGS="$CPPFLAGS -I$withval" + AC_MSG_RESULT(found $withval/apr.h) + fi + ],) + AC_MSG_RESULT(found $HTTPD_DIR) ],[ |
From: Mod C. C. L. <mod...@so...> - 2004-05-07 23:26:30
|
Mod Cplusplus CVS committal Author : johnksterling Module : mod_cplusplus Dir : mod_cplusplus Modified Files: autogen.sh configure.in Log Message: start working to a more flexible build system that picks up files on different types of systems =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/autogen.sh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- autogen.sh 9 May 2001 04:26:07 -0000 1.1.1.1 +++ autogen.sh 7 May 2004 23:26:24 -0000 1.2 @@ -8,7 +8,13 @@ PROJECT=mod_cplusplus TEST_TYPE=-f FILE=src/mod_cplusplus.c - +LIBTOOLIZE=libtoolize +LIBTOOLIZE_EXISTS=`which $LIBTOOLIZE` +if test -f "$LIBTOOLIZE_EXISTS" ; then + LIBTOOLIZE=libtoolize +else + LIBTOOLIZE=glibtoolize +fi DIE=0 (autoconf --version) < /dev/null > /dev/null 2>&1 || { @@ -47,7 +53,7 @@ aclocal (autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader -libtoolize --force --copy +$LIBTOOLIZE --force --copy automake -a $am_opt autoconf cd $ORIGDIR @@ -55,4 +61,4 @@ $srcdir/configure "$@" echo -echo "Now type 'gmake' to compile $PROJECT." +echo "Now type 'make' to compile $PROJECT." =================================================================== RCS file: /cvsroot/modcplusplus/mod_cplusplus/configure.in,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- configure.in 20 Aug 2003 01:36:54 -0000 1.16 +++ configure.in 7 May 2004 23:26:24 -0000 1.17 @@ -25,15 +25,24 @@ CPPFLAGS="$CPPFLAGS -DAP_HAVE_DESIGNATED_INITIALIZER" fi - + AC_MSG_CHECKING(for standard packaging) searchfile="$withval/include/httpd.h" if test -f $searchfile ; then HTTPD_DIR=`cd $withval; pwd` CPPFLAGS="$CPPFLAGS -I$HTTPD_DIR/include" else - AC_MSG_ERROR($searchfile not found) + AC_MSG_RESULT($searchfile not found) fi - AC_MSG_RESULT(found $HTTPD_DIR) + AC_MSG_CHECKING(for alternative default packaging) + searchfile="$withval/include/apache2/httpd.h" + if test -f $searchfile ; then + HTTPD_DIR=`cd $withval; pwd` + CPPFLAGS="$CPPFLAGS -I$HTTPD_DIR/include/apache2" + else + AC_MSG_RESULT($searchfile not found) + fi + +AC_MSG_RESULT(found $HTTPD_DIR) ],[ AC_MSG_ERROR(--with-httpd not given) ]) |
From: Mod C. C. L. <mod...@so...> - 2003-11-15 16:11:26
|
Mod Cplusplus CVS committal Author : johnksterling Project : apr_cplusplus Module : test Dir : apr_cplusplus/test Modified Files: test_anyfile.cpp test_path.cpp test_time.cpp Log Message: make tests pass on darwin... some funny ones in there due to darwin softlinks :) =================================================================== RCS file: /cvsroot/modcplusplus/apr_cplusplus/test/test_anyfile.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- test_anyfile.cpp 23 Feb 2002 21:15:51 -0000 1.2 +++ test_anyfile.cpp 15 Nov 2003 16:11:24 -0000 1.3 @@ -8,15 +8,15 @@ /* this test only works on unix */ static int test_info(apr_pool_t *pool) { int res = 0; - APRAnyFile *file = new APRAnyFile(pool, "/etc"); + APRAnyFile *file = new APRAnyFile(pool, "/private/etc"); APRAnyFile *file2 = NULL; apr_finfo_t *info = (apr_finfo_t *)apr_pcalloc(pool, sizeof(*info)); - apr_stat(info, "/etc", 0, pool); + apr_stat(info, "/private/etc", 0, pool); file->Stat(); if ((file->Info())->nlink != info->nlink) { - printf("Number of lnks to /etc mismatch after stat.\n"); + printf("Number of lnks to /etc mismatch after stat. %d != %d\n", (int)(file->Info())->nlink, (int)info->nlink); res = 1; } =================================================================== RCS file: /cvsroot/modcplusplus/apr_cplusplus/test/test_path.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- test_path.cpp 22 Feb 2002 16:35:51 -0000 1.1 +++ test_path.cpp 15 Nov 2003 16:11:24 -0000 1.2 @@ -36,8 +36,9 @@ static int test_chdir(apr_pool_t *pool) { int res = 0; APRPath::SetCwd("/etc", pool); - if (strcmp(APRPath::GetCwd(0, pool), "/etc")) { - printf("Oops, unable to chdir to /etc.\n"); + if (strcmp(APRPath::GetCwd(0, pool), "/etc") && + strcmp(APRPath::GetCwd(0, pool), "/private/etc")) { + printf("Oops, unable to chdir to /etc. %s\n", APRPath::GetCwd(0, pool)); res = 1; } return res; =================================================================== RCS file: /cvsroot/modcplusplus/apr_cplusplus/test/test_time.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- test_time.cpp 15 Nov 2003 16:00:01 -0000 1.2 +++ test_time.cpp 15 Nov 2003 16:11:24 -0000 1.3 @@ -9,12 +9,12 @@ #include "cpp_time.h" -/* this is Thu Jul 22 09:13:20 1976 Pacific */ +/* this is Thu Jul 22 12:13:20 1976 EST */ #define TEST_TIME 206900000 #define RFC822_DATE "Thu, 22 Jul 1976 16:13:20 GMT" -#define CTIME "Thu Jul 22 09:13:20 1976" +#define CTIME "Thu Jul 22 12:13:20 1976" #define FORMAT_STRING "%D %T" -#define FORMAT_DATE "07/22/76 09:13:20" +#define FORMAT_DATE "07/22/76 12:13:20" static int test_sleep(apr_pool_t *pool) { int res = 0; @@ -90,7 +90,7 @@ printf("Minutes wrong.\n"); res = 1; } - if (pTime->LocalHour() != 9) { + if (pTime->LocalHour() != 12) { printf("Hour wrong.\n"); res = 1; } @@ -118,8 +118,8 @@ printf("IsDaylightSaving wrong.\n"); res = 1; } - if (pTime->LocalGMTOffset() != -25200) { - printf("GMTOffset wrong.\n"); + if (pTime->LocalGMTOffset() != -14400) { + printf("GMTOffset wrong: %d.\n", pTime->LocalGMTOffset()); res = 1; } |
From: Mod C. C. L. <mod...@so...> - 2003-11-15 16:00:02
|
Mod Cplusplus CVS committal Author : johnksterling Project : apr_cplusplus Module : test Dir : apr_cplusplus/test Modified Files: Makefile.am test_time.cpp Log Message: make the tests build on darwin. currently more than half pass - i think they are pst vs est issues. working on them now. =================================================================== RCS file: /cvsroot/modcplusplus/apr_cplusplus/test/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- Makefile.am 23 Feb 2002 21:14:50 -0000 1.7 +++ Makefile.am 15 Nov 2003 16:00:01 -0000 1.8 @@ -2,14 +2,14 @@ LIB_PTHREAD=@LIB_PTHREAD@ LIB_DL=@LIB_DL@ -LDFLAGS += -export-dynamic +LDFLAGS=-export-dynamic STANDARD_LDADDS = $(top_srcdir)/src/tables/libcpp_tables.la \ $(top_srcdir)/src/times/libcpp_times.la \ $(top_srcdir)/src/exceptions/libcpp_exceptions.la \ $(top_srcdir)/src/files/libcpp_files.la \ - $(LIB_PTHREAD) $(LIB_DL) -lcrypt \ - $(APR_DIR)/libapr.la + $(LIB_PTHREAD) $(LIB_DL) \ + $(APR_DIR)/lib/libapr-0.la noinst_PROGRAMS = \ test_hash \ =================================================================== RCS file: /cvsroot/modcplusplus/apr_cplusplus/test/test_time.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- test_time.cpp 19 Feb 2002 04:15:17 -0000 1.1 +++ test_time.cpp 15 Nov 2003 16:00:01 -0000 1.2 @@ -1,9 +1,14 @@ #include <string.h> #include <stdio.h> +// since this is a cplusplus program you ne3ed the constants macros explicitly set +#define __STDC_CONSTANT_MACROS 1 +#include <stdint.h> +#include <time.h> #include "apr_general.h" #include "apr.h" #include "cpp_time.h" + /* this is Thu Jul 22 09:13:20 1976 Pacific */ #define TEST_TIME 206900000 #define RFC822_DATE "Thu, 22 Jul 1976 16:13:20 GMT" @@ -125,9 +130,9 @@ int res = 0; APRTime *pTime = new APRTime(pool, (time_t)TEST_TIME); APRTime *implodedTime; - apr_exploded_time_t *xTime; - apr_exploded_time_t *xGMTTime; - apr_exploded_time_t *xLocalTime; + apr_time_exp_t *xTime; + apr_time_exp_t *xGMTTime; + apr_time_exp_t *xLocalTime; xTime = pTime->ExplodedTime(0); xGMTTime = pTime->ExplodedGMTTime(); |
From: Mod C. C. L. <mod...@so...> - 2003-11-15 15:42:03
|
Mod Cplusplus CVS committal Author : johnksterling Project : apr_cplusplus Module : src Dir : apr_cplusplus/src/tables Modified Files: cpp_tables.cpp Log Message: fix this to compile since there is some interest in looking at it again =================================================================== RCS file: /cvsroot/modcplusplus/apr_cplusplus/src/tables/cpp_tables.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- cpp_tables.cpp 21 Nov 2001 16:49:13 -0000 1.3 +++ cpp_tables.cpp 15 Nov 2003 15:41:32 -0000 1.4 @@ -1,7 +1,7 @@ #include "cpp_tables.h" /* APRTable class */ -APRTable::APRTable(apr_pool_t *pool, int nelts = 10) +APRTable::APRTable(apr_pool_t *pool, int nelts) { mTable = apr_table_make(pool, nelts); } @@ -30,7 +30,7 @@ void APRTableIterator::Init() { - const apr_array_header_t *header = apr_table_elts(mTable); + const apr_array_header_t *header = apr_table_elts(mTable->GetTable()); mArray = (apr_table_entry_t *)header->elts; mCurItem = 0; } |