modsnake-cvs Mailing List for mod_snake - Apache modules in Python
Status: Alpha
Brought to you by:
jick
You can subscribe to this list here.
2002 |
Jan
(13) |
Feb
(1) |
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Mod S. C. L. <mod...@so...> - 2002-04-11 20:52:27
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : examples Dir : mod_snake/examples/filters Modified Files: gzip_filter.py Log Message: Update to new filter API =================================================================== RCS file: /cvsroot/modsnake/mod_snake/examples/filters/gzip_filter.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- gzip_filter.py 30 Jan 2001 06:41:46 -0000 1.3 +++ gzip_filter.py 11 Apr 2002 20:51:53 -0000 1.4 @@ -127,7 +127,7 @@ module.add_hook('create_dir_config', self.create_dir_config) module.register_output_filter(FILTERNAME, self.gzip_filter, - mod_snake.AP_FTYPE_CONTENT) + mod_snake.AP_FTYPE_CONTENT_SET) directives = { "GzipEnable" : (mod_snake.OR_ALL, mod_snake.FLAG, self.cmd_GzipEnable), "GzipLevel" : (mod_snake.OR_ALL, mod_snake.TAKE1, |
From: Mod S. C. L. <mod...@so...> - 2002-04-11 20:51:57
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : testsuite Dir : mod_snake/testsuite/modules Modified Files: a2bconn_filter.py a2bfilter.py Log Message: Update to new filter API =================================================================== RCS file: /cvsroot/modsnake/mod_snake/testsuite/modules/a2bconn_filter.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- a2bconn_filter.py 12 Feb 2001 06:07:23 -0000 1.1 +++ a2bconn_filter.py 11 Apr 2002 20:51:53 -0000 1.2 @@ -6,7 +6,7 @@ module.add_hook('content_handler', self.content_handler) module.add_hook('create_svr_config', self.create_svr_config) module.register_output_filter('a2bconn', self.a2bconn_filter, - mod_snake.AP_FTYPE_CONTENT) + mod_snake.AP_FTYPE_RESOURCE) module.add_directives({'a2bconn_filter' : (mod_snake.RSRC_CONF, mod_snake.FLAG, self.cmd_filter)}) =================================================================== RCS file: /cvsroot/modsnake/mod_snake/testsuite/modules/a2bfilter.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- a2bfilter.py 12 Feb 2001 06:04:40 -0000 1.2 +++ a2bfilter.py 11 Apr 2002 20:51:53 -0000 1.3 @@ -5,7 +5,7 @@ module.add_hook('insert_filter', self.insert_filter) module.add_hook('content_handler', self.content_handler) module.register_output_filter('a2b', self.a2b_filter, - mod_snake.AP_FTYPE_CONTENT) + mod_snake.AP_FTYPE_RESOURCE) def content_handler(self, per_dir, per_svr, r): if r.uri == '/a2b_filter': |
From: Mod S. C. L. <mod...@so...> - 2002-04-11 20:44:04
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : src Dir : mod_snake/src Modified Files: bucket.i Log Message: Fixup for Apache 2.0 "gold" API. Patch from Zander Lichstein <ZLi...@L9...> =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/bucket.i,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- bucket.i 12 Feb 2001 06:11:24 -0000 1.11 +++ bucket.i 11 Apr 2002 20:43:59 -0000 1.12 @@ -272,7 +272,7 @@ #else apr_bucket *eos; - if((eos = apr_bucket_eos_create()) == NULL){ + if((eos = apr_bucket_eos_create(brigade->bucket_alloc)) == NULL){ PyErr_SetString(PyExc_MemoryError, "internal bucket creation error"); return NULL; } |
From: Mod S. C. L. <mod...@so...> - 2002-04-09 20:13:04
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : src Dir : mod_snake/src Modified Files: conn_rec.i filter.i mod_snake.c mod_snake_buf.c mod_snake_buf.h request_rec.i snake_modules.c Log Message: Get up-to-date with Apache 2.0 code changes. =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/conn_rec.i,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- conn_rec.i 10 Jan 2002 22:29:32 -0000 1.20 +++ conn_rec.i 9 Apr 2002 20:13:03 -0000 1.21 @@ -175,7 +175,7 @@ apr_bucket_brigade *brigade; PyObject *res; - brigade = apr_brigade_create(conn->pool); + brigade = apr_brigade_create(conn->pool, conn->bucket_alloc); if((res = mod_snake_get_apr_bucket_brigade_shadowclass(brigade)) == NULL){ apr_brigade_destroy(brigade); return NULL; =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/filter.i,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- filter.i 11 Feb 2001 01:24:38 -0000 1.8 +++ filter.i 9 Apr 2002 20:13:03 -0000 1.9 @@ -86,8 +86,14 @@ %} -enum {AP_FTYPE_CONTENT, AP_FTYPE_HTTP_HEADER, AP_FTYPE_TRANSCODE, - AP_FTYPE_CONNECTION, AP_FTYPE_NETWORK }; +enum { + AP_FTYPE_RESOURCE, + AP_FTYPE_CONTENT_SET, + AP_FTYPE_PROTOCOL, + AP_FTYPE_TRANSCODE, + AP_FTYPE_CONNECTION, + AP_FTYPE_NETWORK +}; %readonly typedef struct ap_filter_t { =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/mod_snake.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -3 -r1.29 -r1.30 --- mod_snake.c 7 Jan 2002 06:35:18 -0000 1.29 +++ mod_snake.c 9 Apr 2002 20:13:03 -0000 1.30 @@ -718,7 +718,7 @@ } static -int mod_snake_pre_connection_cb(conn_rec *c){ +int mod_snake_pre_connection_cb(conn_rec *c, void *csd){ return mod_snake_generic_connection_cb(c, SNAKE_HOOK_PRE_CONNECTION); } =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/mod_snake_buf.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- mod_snake_buf.c 10 Jan 2002 18:54:58 -0000 1.6 +++ mod_snake_buf.c 9 Apr 2002 20:13:03 -0000 1.7 @@ -80,10 +80,11 @@ * On failure, the buffer will not be touched. */ -apr_bucket *mod_snake_buf_bucketize(ModSnakeBuf *buf){ +apr_bucket *mod_snake_buf_bucketize(ModSnakeBuf *buf, apr_bucket_alloc_t *fl){ apr_bucket *res; - if(!(res = apr_bucket_heap_create(buf->data, buf->endp - buf->data, 1))) + if(!(res = apr_bucket_heap_create(buf->data, buf->endp - buf->data, + NULL, fl))) return NULL; return res; } =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/mod_snake_buf.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- mod_snake_buf.h 27 Jan 2001 20:21:05 -0000 1.4 +++ mod_snake_buf.h 9 Apr 2002 20:13:03 -0000 1.5 @@ -14,7 +14,8 @@ extern ModSnakeBuf *mod_snake_buf_create(int bufsize); extern void mod_snake_buf_append(ModSnakeBuf *buf, const char *data, int len); extern int mod_snake_buf_size_left(ModSnakeBuf *buf); -extern apr_bucket *mod_snake_buf_bucketize(ModSnakeBuf *buf); +extern apr_bucket *mod_snake_buf_bucketize(ModSnakeBuf *buf, + apr_bucket_alloc_t *flist); extern void mod_snake_buf_destroy(ModSnakeBuf *buf); #endif =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/request_rec.i,v retrieving revision 1.32 retrieving revision 1.33 diff -u -3 -r1.32 -r1.33 --- request_rec.i 10 Jan 2002 22:29:32 -0000 1.32 +++ request_rec.i 9 Apr 2002 20:13:03 -0000 1.33 @@ -225,9 +225,9 @@ if(len < bufleft) /* Return if we didn't fill the buffer */ return 0; - brigade = apr_brigade_create(req->pool); + brigade = apr_brigade_create(req->pool, req->connection->bucket_alloc); /* Always add the bucket we just finished */ - if((bucket = mod_snake_buf_bucketize(buf)) == NULL){ + if(!(bucket = mod_snake_buf_bucketize(buf, req->connection->bucket_alloc))){ mod_snake_buf_destroy(buf); return -1; } @@ -261,8 +261,10 @@ if(!rcfg->curbuf) return ap_rflush(r); - brigade = apr_brigade_create(r->pool); - if((bucket = mod_snake_buf_bucketize(rcfg->curbuf)) == NULL){ + brigade = apr_brigade_create(r->pool, r->connection->bucket_alloc); + if((bucket = mod_snake_buf_bucketize(rcfg->curbuf, + r->connection->bucket_alloc)) == NULL) + { mod_snake_buf_destroy(rcfg->curbuf); /* XXX -- Raise an exception? */ return 0; } @@ -420,7 +422,7 @@ apr_bucket_brigade *brigade; PyObject *res; - brigade = apr_brigade_create(rec->pool); + brigade = apr_brigade_create(rec->pool, rec->connection->bucket_alloc); if((res = mod_snake_get_apr_bucket_brigade_shadowclass(brigade)) == NULL){ apr_brigade_destroy(brigade); return NULL; =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/snake_modules.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -3 -r1.29 -r1.30 --- snake_modules.c 7 Jan 2002 06:35:18 -0000 1.29 +++ snake_modules.c 9 Apr 2002 20:13:03 -0000 1.30 @@ -668,14 +668,16 @@ apr_bucket_brigade *brigade; apr_bucket *bucket; - brigade = apr_brigade_create(r->pool); + brigade = apr_brigade_create(r->pool, r->connection->bucket_alloc); if(rcfg->curbuf){ if(res == HTTP_INTERNAL_SERVER_ERROR){ mod_snake_buf_destroy(rcfg->curbuf); mod_snake_destroy_thread_and_unlock(tstate); return res; } - if((bucket = mod_snake_buf_bucketize(rcfg->curbuf)) == NULL){ + if(!(bucket = mod_snake_buf_bucketize(rcfg->curbuf, + r->connection->bucket_alloc))) + { mod_snake_buf_destroy(rcfg->curbuf); PyErr_SetString(PyExc_MemoryError, "failed to bucketize buffer"); mod_snake_destroy_thread_and_unlock(tstate); @@ -683,7 +685,7 @@ } APR_BRIGADE_INSERT_TAIL(brigade, bucket); } - bucket = apr_bucket_eos_create(); + bucket = apr_bucket_eos_create(r->connection->bucket_alloc); APR_BRIGADE_INSERT_TAIL(brigade, bucket); ap_pass_brigade(r->output_filters, brigade); } |
From: Mod S. C. L. <mod...@so...> - 2002-04-09 17:52:03
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : examples Dir : mod_snake/examples/tut Modified Files: 04_namegame.pycgi Log Message: Use correct env =================================================================== RCS file: /cvsroot/modsnake/mod_snake/examples/tut/04_namegame.pycgi,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- 04_namegame.pycgi 21 Aug 2000 18:22:18 -0000 1.1 +++ 04_namegame.pycgi 9 Apr 2002 17:52:01 -0000 1.2 @@ -17,7 +17,7 @@ print 'Content-Type: text/html' print -form = cgi.FieldStorage() +form = cgi.FieldStorage(None, None, "", os.environ) print '<HTML><HEAD><H1>The Name Game</H1></HEAD><BODY>' if not form.has_key('user_name'): |
From: Mod S. C. L. <mod...@so...> - 2002-02-03 20:59:20
|
Mod Snake CVS committal Author : jick Module : mod_snake Dir : mod_snake Modified Files: README Log Message: Fix up documentation pointers, thanks to Ken Coar. =================================================================== RCS file: /cvsroot/modsnake/mod_snake/README,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- README 2000/11/27 15:40:49 1.7 +++ README 2002/02/03 20:59:19 1.8 @@ -10,16 +10,20 @@ understand and maintain. Key files which are distributed in this package are: - doc/mod_snake.txt - Installation and simple usage instructions - doc/mod_snake_api.txt - Reference information about all the different - APIs available through mod_snake - doc/snake_lib.txt - Reference information about the snake_lib - utility modules, distributed with mod_snake - examples/* - Simple examples to show usage - examples/tut/* - Tutorial files for getting started - snake_lib/* - Distributed SnakeLib modules - COPYING - License information - ChangeLog - Information about changes between versions + doc/mod_snake/mod_snake.html - Installation and simple usage + instructions + doc/mod_snake_api/modsnake-api.html - Reference information about all + the different APIs available through + mod_snake + doc/snake_lib/snakelib.html - Reference information about the + snake_lib utility modules, distributed + with mod_snake + examples/* - Simple examples to show usage + examples/tut/* - Tutorial files for getting started + snake_lib/* - Distributed SnakeLib modules + COPYING - License information + ChangeLog - Information about changes between + versions Enjoy. |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 22:32:16
|
Mod Snake CVS committal Author : jick Module : mod_snake Dir : mod_snake Modified Files: ChangeLog Log Message: Fix usrename formatting, and add things that were done today. =================================================================== RCS file: /cvsroot/modsnake/mod_snake/ChangeLog,v retrieving revision 1.54 retrieving revision 1.55 diff -u -3 -r1.54 -r1.55 --- ChangeLog 2001/04/01 18:20:38 1.54 +++ ChangeLog 2002/01/10 22:32:15 1.55 @@ -1,83 +1,95 @@ -2001-02-27 <Jon Travis (jt...@p0...)> +2002-01-10 Jon Travis <jt...@p0...> + * Get things working much better with Apache 1.3 + + * Fixed problem that bit numerous people with shipping a + 'pre built' mod_snake_py.c -- should run against any Python + version now. + + * Fixed up the testsuite that gets shipped with distributions. + + * Got things working with Apache 2.0 again. + +2001-02-27 Jon Travis <jt...@p0...> + * Removed mod_snake_epy's reliance on threading, if Python's threading module is not available. Submitted by: Michael Owens <ow...@ea...> -2001-02-27 <Jon Travis (jt...@p0...)> +2001-02-27 Jon Travis <jt...@p0...> * Add __name__ = '__main__' to the namespace for mod_snake_cgi. Submitted by: Robert Bill <rb...@di...> -2001-02-11 <Jon Travis (jt...@p0...)> +2001-02-11 Jon Travis <jt...@p0...> * Cleaned up mod_snake internals wrt how filters are handled. They now consume less space, and should be more flexible and (some parts) faster. Also added the ability for conn_rec's to have output filters, and associated tests (a2bconn_filter). -2001-02-04 <Jon Travis (jt...@p0...)> +2001-02-04 Jon Travis <jt...@p0...> * Fixed an issue with mod_snake_epy interaction with cgi.py. x-www-form-urlencoded was not working for forms. Reported by Erno Kuusela -2001-02-04 <Jon Travis (jt...@p0...)> +2001-02-04 Jon Travis <jt...@p0...> * Escape traceback before sending it off to the browser. ---------- mod_snake 0.5.0 release ------------ -2001-02-01 <Jon Travis (jt...@p0...)> +2001-02-01 Jon Travis <jt...@p0...> * Created a RPM .spec file for mod_snake. It installs the module, documentation, snake_lib, and examples. In addition it updates the configuration file as best it can with APXS. -2001-01-30 <Jon Travis (jt...@p0...)> +2001-01-30 Jon Travis <jt...@p0...> * Fixed a problem with the 02_hello_world example writing out data before the headers. This was only evident in Apache 2.0. Added test hello_world_2 for verification. -2001-01-29 <Jon Travis (jt...@p0...)> +2001-01-29 Jon Travis <jt...@p0...> * Fixed a problem with the gzip filter, which had an issue due to catching up with Apache. New test (gzip_filter) added. -2001-01-29 <Jon Travis (jt...@p0...)> +2001-01-29 Jon Travis <jt...@p0...> * Moved request_rec.notes into an Apache request_rec->request_config style structure instead of abusing notes. Also fixed a bug with using the notes (leaked refcount) in general. Associated test is reqnotes.py. -2001-01-22 <Jon Travis (jt...@p0...)> +2001-01-22 Jon Travis <jt...@p0...> * Added the beginning of a testing framework in the 'testsuite' directory. -2001-01-20 <Jon Travis (jt...@p0...)> +2001-01-20 Jon Travis <jt...@p0...> * Added example filters to the distribution. This includes an 'on-the-fly' GZIP compressor, and a bucket debugger. -2001-01-03 <Jon Travis (jt...@p0...)> +2001-01-03 Jon Travis <jt...@p0...> * Fixed Apache 2.0's disallowance of NULL pools. -2001-01-02 <Jon Travis (jt...@p0...)> +2001-01-02 Jon Travis <jt...@p0...> * Added ap_validate_password call for password checking of hashed passwords. This routine is available as mod_snake.ap_validate_password(password, hashed_pword) -2000-12-20 <Jon Travis (jt...@p0...)> +2000-12-20 Jon Travis <jt...@p0...> * Many improvements to the build system. This improves the portability (removed gmakeisms), and system specific libs when building non-dso -2000-11-26 <Jon Travis (jt...@p0...)> +2000-11-26 Jon Travis <jt...@p0...> * Made a new configure flag '--enable-dso', which enables or disables the creation of a DSO module. Now there are only 3 possibilities which @@ -88,132 +100,132 @@ At this point, only Apache 2.0 static builds are not supported. -2000-11-24 <Jon Travis (jt...@p0...)> +2000-11-24 Jon Travis <jt...@p0...> * Fixed build system. Build flags are now based on the ones which Python uses to build. This should be far more portable. Also eliminated usage of Automake. -2000-10-30 <Jon Travis (jt...@p0...)> +2000-10-30 Jon Travis <jt...@p0...> * Fixed problem with mod_snake_cgi with extra CRs being sent out. -2000-10-22 <Jon Travis (jt...@co...)> +2000-10-22 Jon Travis <jt...@p0...> * Fixed hack in the gzip filter example, which could be removed because of fixes in Apache-2.0 -2000-10-20 <Jon Travis (jt...@co...)> +2000-10-20 Jon Travis <jt...@p0...> * Fixed some dependencies on GNU make, and gcc. -2000-10-20 <Jon Travis (jt...@co...)> +2000-10-20 Jon Travis <jt...@p0...> * HTML documentation is now included in source tarballs. -2000-10-19 <Jon Travis (jt...@co...)> +2000-10-19 Jon Travis <jt...@p0...> * Added example filters (gzip_filter, bucket_dumper) to demonstrate how output filters can work in Apache 2.0 -2000-10-19 <Jon Travis (jt...@co...)> +2000-10-19 Jon Travis <jt...@p0...> * Fixed an issue with Python 2.0 not working correctly with Apache 1.3 static modules. -2000-10-19 <Jon Travis (jt...@co...)> +2000-10-19 Jon Travis <jt...@p0...> * Added the ability to build against arbitrary Python versions installed on a given machine -- handy for those who have 1.5 and 2.0 installed, but want to try either in mod_snake. -2000-10-19 <Jon Travis (jt...@co...)> +2000-10-19 Jon Travis <jt...@p0...> * Fixed build issues on some platforms where Python's modlibs, etc. are used. -2000-10-19 <Jon Travis (jt...@co...)> +2000-10-19 Jon Travis <jt...@p0...> * Made the request_rec.notes attribute useful. Now this value holds a dictionary during the requests's lifetime, which modules can use to put any temporary data they wish. -2000-10-12 <Jon Travis (jt...@co...)> +2000-10-12 Jon Travis <jt...@p0...> * Patch from Jeff Epler (je...@in...) for drastically speeding up processing of embedded Python. -2000-10-04 <Jon Travis (jt...@co...)> +2000-10-04 Jon Travis <jt...@p0...> * Fixed mod_snake_cgi to respect Options ExecCGI -2000-10-04 <Jon Travis (jt...@co...)> +2000-10-04 Jon Travis <jt...@p0...> * Added the ability to build Apache 1.3 DSO's through APXS. -2000-10-03 <Jon Travis (jt...@co...)> +2000-10-03 Jon Travis <jt...@p0...> * Fixed the build so that it no longer requires to build against a source distribution. This was, at one time, a requirement due to the infancy of 2.0 installations. -2000-10-01 <Jon Travis (jt...@co...)> +2000-10-01 Jon Travis <jt...@p0...> * Fixed mod_snake_cgi to change into the directory of the executed CGI. It also now uses the request_file, request_rec wrapper. This makes things like multipart form data work correctly with Python's cgi.py. -2000-09-30 <Jon Travis (jt...@co...)> +2000-09-30 Jon Travis <jt...@p0...> * **COMPAT** Removed mod_snake_emb snakelib module. This is deprecated by mod_snake_epy, which is much more flexible and powerful. -2000-09-30 <Jon Travis (jt...@co...)> +2000-09-30 Jon Travis <jt...@p0...> * Converted documentation from legacy LyX format, to SGML/DocBook stylee. -2000-09-27 <Jon Travis (jt...@co...)> +2000-09-27 Jon Travis <jt...@p0...> * Fixed ap_server_root_relative, in apache_api.i. Under Apache 1.3, NULL pools are a bit broken. Under 2.0, they can be used. -2000-09-27 <Jon Travis (jt...@co...)> +2000-09-27 Jon Travis <jt...@p0...> * Added mod_snake_epy, snakelib module. This module has a lot more power, and is written much better than mod_snake_emb. It should support apache-2.0 filtering, cgi.py, etc. -2000-09-26 <Jon Travis (jt...@co...)> +2000-09-26 Jon Travis <jt...@p0...> * Fixed a crasher when request_rec.content_{type,encoding} are NULL -2000-09-24 <Jon Travis (jt...@co...)> +2000-09-24 Jon Travis <jt...@p0...> * Added emb_html.py, module for processing embedded Python. Modules incorprating this, should slowly deprecate mod_snake_emb -2000-09-24 <Jon Travis (jt...@co...)> +2000-09-24 Jon Travis <jt...@p0...> * Fixed request_rec.rflush() when running under Apache 2.0, to use the request's buffered data, and pass it down via the brigade. -2000-09-24 <Jon Travis (jt...@co...)> +2000-09-24 Jon Travis <jt...@p0...> * Updated to use Swig 1.3a5, which should give a bit of a speedup. -2000-09-24 <Jon Travis (jt...@co...)> +2000-09-24 Jon Travis <jt...@p0...> * Added directory configuration information to the request_rec -2000-09-20 <Jon Travis (jt...@co...)> +2000-09-20 Jon Travis <jt...@p0...> * Moved TODO entries and bugs to SourceForge -2000-09-04 <Jon Travis (jt...@co...)> +2000-09-04 Jon Travis <jt...@p0...> * Modified conn_rec attributes 'local_addr' and 'remote_addr', to return port number information in a @@ -221,49 +233,49 @@ ---------- mod_snake 0.4.1 release ------------ -2000-08-30 <Jon Travis (jt...@co...)> +2000-08-30 Jon Travis <jt...@p0...> * Fixed up the mod_snake_emb module to use the string module. This also fixed a couple off-by-one bugs. -2000-08-27 <Jon Travis (jt...@co...)> +2000-08-27 Jon Travis <jt...@p0...> * Fixed up mod_snake_emb to use the rwrite method of the request object, as opposed to the connection_rec's write cmd. -2000-08-27 <Jon Travis (jt...@co...)> +2000-08-27 Jon Travis <jt...@p0...> * Fixed a problem with internal directive information being corrupted. -2000-08-25 <Jon Travis (jt...@co...)> +2000-08-25 Jon Travis <jt...@p0...> * Added a post-config callback hook. -2000-08-25 <Jon Travis (jt...@co...)> +2000-08-25 Jon Travis <jt...@p0...> * Added interface into Apache's req->finfo. This removes the stat() calls in some of the snakelib modules. -2000-08-25 <Jon Travis (jt...@co...)> +2000-08-25 Jon Travis <jt...@p0...> * Fixed a potential problem in the mod_snake_cgi module, where client POSTs might not be processed correctly. ---------- mod_snake 0.4.0 release ------------ -2000-08-24 <Jon Travis (jt...@co...)> +2000-08-24 Jon Travis <jt...@p0...> * More cleanups with documentation && open_logs callbacks. Released 0.4.0. -2000-08-23 <Jon Travis (jt...@co...)> +2000-08-23 Jon Travis <jt...@p0...> * Added the mod_snake_info module into SnakeLib. Also added information about how to patch the system's profile to get everything working well with the profiler. -2000-08-20 <Jon Travis (jt...@co...)> +2000-08-20 Jon Travis <jt...@p0...> * Fixed a bunch of problems with making sure everything got deinitialized on pool cleanup. @@ -280,35 +292,35 @@ the request object (ap_rwrite, and friends). Also fixed up the mod_snake_cgi module to handle these new functions. -2000-06-29 <Jon Travis (jt...@p0...)> +2000-06-29 Jon Travis <jt...@p0...> * Fixed a problem with modules that don't hook into the create_dir_config hook. ---------- mod_snake 0.2.0 release ------------ -2000-06-26 <Jon Travis (jt...@p0...)> +2000-06-26 Jon Travis <jt...@p0...> * Added ability to load mod_snake into Apache 1.3 courtesy of Ryan Morgan (rm...@co...) -2000-06-25 <Jon Travis (jt...@p0...)> +2000-06-25 Jon Travis <jt...@p0...> * Fixed up the Makefiles, for what gets installed, and what gets built. This should reduce requirements for regular non-maintainer (dist) people. -2000-06-25 <Jon Travis (jt...@p0...)> +2000-06-25 Jon Travis <jt...@p0...> * Fixed problem with giving the wrong per-dir configuration directives out to PyMods. PyMods should now ALWAYS get a per-dir configuration on callbacks. -2000-06-23 <Jon Travis (jt...@p0...)> +2000-06-23 Jon Travis <jt...@p0...> * Added merge_dir_config hooks for Pymods to access. -2000-06-23 <Jon Travis (jt...@p0...)> +2000-06-23 Jon Travis <jt...@p0...> * Fixed problem with mod_snake_emb writing out non-strings |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 22:31:41
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : testsuite Dir : mod_snake/testsuite Modified Files: Makefile.in Log Message: Make sure we ship everything that people will need to run the testsuite. =================================================================== RCS file: /cvsroot/modsnake/mod_snake/testsuite/Makefile.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- Makefile.in 2001/01/30 06:40:23 1.3 +++ Makefile.in 2002/01/10 22:31:40 1.4 @@ -5,11 +5,16 @@ dist: -mkdir -p $(DISTDIR)/conf -mkdir -p $(DISTDIR)/logs + -mkdir -p $(DISTDIR)/modules + -mkdir -p $(DISTDIR)/tests -mkdir -p $(DISTDIR)/htdocs/images cp -p conf/*.in conf/mime.types conf/magic $(DISTDIR)/conf cp -p run_tests.py server_config.py.in Makefile.in $(DISTDIR) - cp -p htdocs/image_send.epy $(DISTDIR)/htdocs - cp -p htdocs/images/foo.jpg $(DISTDIR)/htdocs + cp -p testutil.py $(DISTDIR) + cp -p htdocs/image_send.epy htdocs/formtest.epy $(DISTDIR)/htdocs + cp -p htdocs/images/foo.jpg $(DISTDIR)/htdocs/images + cp -p modules/*.py $(DISTDIR)/modules + cp -p tests/*.py $(DISTDIR)/tests check: @$(PYTHON_BIN) run_tests.py |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 22:29:33
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : src Dir : mod_snake/src Modified Files: conn_rec.i mod_snake.i request_rec.i snake_apr_compat.h Log Message: Fix up warnings that we get when building for Apache 1.3 =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/conn_rec.i,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- conn_rec.i 2002/01/07 06:35:18 1.19 +++ conn_rec.i 2002/01/10 22:29:32 1.20 @@ -190,7 +190,7 @@ PyObject *data) { #ifdef APACHE13 - SNAKE13_UNSUP_VOID(); + SNAKE13_UNSUP(NULL); #else if(mod_snake_add_output_filter_pyhook(NULL, conn, filtername, data) == -1) return NULL; =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/mod_snake.i,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- mod_snake.i 2001/02/12 03:52:50 1.22 +++ mod_snake.i 2002/01/10 22:29:32 1.23 @@ -339,7 +339,7 @@ const char *name, PyObject *func, int ftype) { #ifdef APACHE13 - SNAKE13_UNSUP_VOID(); + SNAKE13_UNSUP(-1); #else ModSnakeRegFilter *rfilter; char *real_name; =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/request_rec.i,v retrieving revision 1.31 retrieving revision 1.32 diff -u -3 -r1.31 -r1.32 --- request_rec.i 2002/01/07 06:35:18 1.31 +++ request_rec.i 2002/01/10 22:29:32 1.32 @@ -84,7 +84,7 @@ #endif } -static char *request_rec_content_language_get(request_rec *obj){ +static const char *request_rec_content_language_get(request_rec *obj){ #ifdef APACHE13 return obj->content_language; #else @@ -435,7 +435,7 @@ const char *filtername, PyObject *data) { #ifdef APACHE13 - SNAKE13_UNSUP_VOID(); + SNAKE13_UNSUP(NULL); #else if(mod_snake_add_output_filter_pyhook(req, req->connection, filtername, data) == -1) @@ -560,7 +560,7 @@ char *handler; %addmethods { - char *content_language; + const char *content_language; } ap_array_header_t *content_languages; @@ -583,6 +583,6 @@ %addmethods { PyObject *finfo; } - apr_uri_t parsed_uri; + uri_components parsed_uri; } request_rec; =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/snake_apr_compat.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- snake_apr_compat.h 2001/02/10 09:08:46 1.3 +++ snake_apr_compat.h 2002/01/10 22:29:32 1.4 @@ -106,5 +106,6 @@ #define ap_stat apr_stat #define ap_ssize_t apr_ssize_t #define ap_time_t apr_time_t +#define uri_components apr_uri_t #endif /* SNAKE_APR_COMPAT_H */ |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 22:28:30
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : src Dir : mod_snake/src Modified Files: Makefile.in Log Message: Make sure we distribute mod_snake.py in an un-compiled form, so that different Python versions work with it. =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/Makefile.in,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- Makefile.in 2001/01/21 19:09:05 1.8 +++ Makefile.in 2002/01/10 22:28:30 1.9 @@ -107,8 +107,7 @@ $(CPPFLAGS) $(CFLAGS) $(PYTHON_OPT) -c $< -o $@ -@MAINT_F_RENAME@mod_snake_py.c: -@MAINT_T_RENAME@mod_snake_py.c: mod_snake.py py_to_c +mod_snake_py.c: mod_snake.py py_to_c ./py_to_c mod_snake.py mod_snake_py.c Mod_Snake_Py @@ -128,8 +127,9 @@ clean: rm -f *.o *.lo rm -f py_to_c - rm -f mod_snake.py libmod_snake.so libmod_snake.a + rm -f libmod_snake.so libmod_snake.a @MAINT_T@rm -f mod_snake_py.c mod_snake_wrap.c mod_snake_wrap.doc + @MAINT_T@rm -f mod_snake.py distclean: clean @@ -138,4 +138,4 @@ mod_snake.c mod_snake.h mod_snake_bucket.c mod_snake_bucket.h \ mod_snake_buf.c mod_snake_buf.h mod_snake_py.c mod_snake_wrap.c \ py_to_c.c snake_apr_compat.h snake_modules.c snake_precompile.c \ - snake_precompile.h $(DISTDIR) + snake_precompile.h mod_snake.py $(DISTDIR) |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 22:21:44
|
Mod Snake CVS committal Author : jick Module : mod_snake Dir : mod_snake Added Files: mod_snake.spec.in Removed Files: mod_snake.spec Log Message: Move mod_snake.spec to mod_snake.spec.in so we can substitue in the version number |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 22:20:25
|
Mod Snake CVS committal Author : jick Module : mod_snake Dir : mod_snake Modified Files: configure.in Log Message: Update version # and get documentation distribution correct =================================================================== RCS file: /cvsroot/modsnake/mod_snake/configure.in,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- configure.in 2001/02/04 20:50:05 1.25 +++ configure.in 2002/01/10 22:20:24 1.26 @@ -1,5 +1,5 @@ AC_INIT(src/mod_snake.c) -AM_INIT_AUTOMAKE(mod_snake, 0.5.1) +AM_INIT_AUTOMAKE(mod_snake, 0.5.2) AM_CONFIG_HEADER(src/config.h:config.in) AC_PROG_CC @@ -63,28 +63,52 @@ MAINT_F='#' MAINT_T_RENAME= MAINT_F_RENAME='BIG_RENAME_UNUSED' + + DOC_SUBS="doc/mod_snake.sgml doc/mod_snake_api.sgml doc/snake_lib.sgml" else MAINT_T='#' MAINT_F= MAINT_T_RENAME='BIG_RENAME_UNUSED' MAINT_F_RENAME= + + DOC_SUBS="" fi +DOC_DATE=`date +'%d %B %Y'` + SNAKE_COMPILEDIR=`pwd` -AC_SUBST(MODSNAKE_LIBRARY) -AC_SUBST(MODSNAKE_DSO) AC_SUBST(CPPFLAGS) +AC_SUBST(DOC_DATE) AC_SUBST(LIBS) -AC_SUBST(SWIG) -AC_SUBST(PACKAGE) -AC_SUBST(VERSION) -AC_SUBST(USE_MAINTAINER_MODE) -AC_SUBST(MAINT_T) AC_SUBST(MAINT_F) -AC_SUBST(MAINT_T_RENAME) AC_SUBST(MAINT_F_RENAME) +AC_SUBST(MAINT_T) +AC_SUBST(MAINT_T_RENAME) +AC_SUBST(MODSNAKE_DSO) +AC_SUBST(MODSNAKE_LIBRARY) +AC_SUBST(PACKAGE) AC_SUBST(SNAKE_COMPILEDIR) +AC_SUBST(SWIG) AC_SUBST(TEST_HTTPD) +AC_SUBST(USE_MAINTAINER_MODE) +AC_SUBST(VERSION) -AC_OUTPUT(Makefile doc/Makefile src/Makefile src/libmod_snake.module examples/Makefile examples/tut/Makefile snake_lib/Makefile examples/filters/Makefile testsuite/conf/conf-prefix testsuite/conf/conf-postfix testsuite/conf/httpd2.0.conf testsuite/conf/httpd1.3.conf testsuite/server_config.py testsuite/Makefile) +AC_OUTPUT( + $DOC_SUBS + Makefile + doc/Makefile + examples/Makefile + examples/filters/Makefile + examples/tut/Makefile + mod_snake.spec + snake_lib/Makefile + src/Makefile + src/libmod_snake.module + testsuite/Makefile + testsuite/conf/conf-postfix + testsuite/conf/conf-prefix + testsuite/conf/httpd1.3.conf + testsuite/conf/httpd2.0.conf + testsuite/server_config.py +) |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 22:15:22
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : doc Dir : mod_snake/doc Added Files: mod_snake.sgml.in mod_snake_api.sgml.in snake_lib.sgml.in Removed Files: mod_snake.sgml mod_snake_api.sgml snake_lib.sgml Log Message: Moved *.sgml to *.sgml.in, so that the configure script can substitute in current publishing dates and version numbers. |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 22:15:00
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : doc Dir : mod_snake/doc Modified Files: Makefile.in Log Message: Small fix for how distribution documentation is dealt with =================================================================== RCS file: /cvsroot/modsnake/mod_snake/doc/Makefile.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- Makefile.in 2001/01/21 19:19:27 1.6 +++ Makefile.in 2002/01/10 22:14:59 1.7 @@ -1,15 +1,14 @@ EXTRA_DIST = \ - mod_snake.sgml \ mod_snake.ps \ mod_snake \ - mod_snake_api.sgml \ mod_snake_api.ps \ mod_snake_api \ - snake_lib.sgml \ snake_lib.ps \ snake_lib -all: $(EXTRA_DIST) + +@MAINT_F_RENAME@all: +@MAINT_T_RENAME@all: $(EXTRA_DIST) @MAINT_F_RENAME@dist: @MAINT_T_RENAME@dist: |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 18:56:00
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : src Dir : mod_snake/src Modified Files: mod_snake_bucket.c Log Message: Get the bucket code up-to-date with Apache 2.0 changes. =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/mod_snake_bucket.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- mod_snake_bucket.c 2001/04/30 14:29:43 1.9 +++ mod_snake_bucket.c 2002/01/10 18:55:58 1.10 @@ -52,7 +52,7 @@ ModSnakePyBucket *pybucket = data; /* Check to see if the reference count is up */ - if(apr_bucket_shared_destroy(pybucket)) + if(!apr_bucket_shared_destroy(pybucket)) return; Py_DECREF(pybucket->py_str); @@ -60,10 +60,10 @@ } static const apr_bucket_type_t mod_snake_bucket_type = { - "ModSnake Bucket", 4, + "ModSnake Bucket", 5, mod_snake_pybucket_destroy, mod_snake_pybucket_read, - apr_bucket_setaside_notimpl, + apr_bucket_setaside_noop, apr_bucket_shared_split, apr_bucket_shared_copy, }; @@ -94,6 +94,7 @@ apr_bucket *b = calloc(1, sizeof(*b)); APR_BUCKET_INIT(b); + b->free = free; return mod_snake_pybucket_make(b, strobj, offset, len); } |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 18:55:00
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : src Dir : mod_snake/src Modified Files: mod_snake_buf.c Log Message: We were freeing data when we probably shouldn't have been. =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/mod_snake_buf.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- mod_snake_buf.c 2002/01/07 06:35:18 1.5 +++ mod_snake_buf.c 2002/01/10 18:54:58 1.6 @@ -83,9 +83,8 @@ apr_bucket *mod_snake_buf_bucketize(ModSnakeBuf *buf){ apr_bucket *res; - res = apr_bucket_heap_create(buf->data, buf->endp - buf->data, 0); - if(!res) return NULL; - free(buf); + if(!(res = apr_bucket_heap_create(buf->data, buf->endp - buf->data, 1))) + return NULL; return res; } |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 18:51:37
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : testsuite Dir : mod_snake/testsuite Modified Files: run_tests.py Log Message: Disable mod_echo, since there is no input filtering, and the connection is not directly accessable by the module. =================================================================== RCS file: /cvsroot/modsnake/mod_snake/testsuite/run_tests.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- run_tests.py 2001/01/31 02:36:25 1.6 +++ run_tests.py 2002/01/10 18:50:15 1.7 @@ -18,6 +18,10 @@ print 'Skipped (2.0 only)' continue + if mod.compat == 'disabled': + print 'Disabled' + continue + try: for i in range(10): mod.test() |
From: Mod S. C. L. <mod...@so...> - 2002-01-10 18:50:38
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : testsuite Dir : mod_snake/testsuite/tests Modified Files: mod_echo.py Log Message: Disable mod_echo, since there is no input filtering, and the connection is not directly accessable by the module. =================================================================== RCS file: /cvsroot/modsnake/mod_snake/testsuite/tests/mod_echo.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- mod_echo.py 2001/01/31 02:35:16 1.1 +++ mod_echo.py 2002/01/10 18:50:15 1.2 @@ -1,7 +1,7 @@ import server_config, StringIO, gzip, socket from testutil import * -compat = "2.0" +compat = "disabled" def test(): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
From: Mod S. C. L. <mod...@so...> - 2002-01-07 06:35:21
|
Mod Snake CVS committal Author : jick Project : mod_snake Module : src Dir : mod_snake/src Modified Files: apache_api.i apr.i conn_rec.i mod_snake.c mod_snake.h mod_snake_buf.c request_rec.i snake_modules.c Log Message: Get things working with Apache 2.0 HEAD =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/apache_api.i,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- apache_api.i 2001/02/10 09:08:46 1.15 +++ apache_api.i 2002/01/07 06:35:18 1.16 @@ -123,7 +123,7 @@ #ifdef APACHE13 pool = ap_make_sub_pool(NULL); #else - pool = ap_make_sub_pool(NULL, NULL); + ap_make_sub_pool(&pool, NULL, NULL); #endif while((word = ap_getword_conf(pool, &cp)) && word[0] != '\0'){ pstr = PyString_FromString(word); @@ -152,7 +152,7 @@ #ifdef APACHE13 pool = ap_make_sub_pool(NULL); #else - pool = ap_make_sub_pool(NULL, NULL); + ap_make_sub_pool(&pool, NULL, NULL); #endif rel = ap_server_root_relative(pool, file); res = PyString_FromString(rel); /* Result is incref'd */ =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/apr.i,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- apr.i 2001/01/27 20:21:05 1.6 +++ apr.i 2002/01/07 06:35:18 1.7 @@ -65,7 +65,7 @@ static PyObject *ap_table_t_get_keys_or_values(ap_table_t *table, int is_keys){ PyObject *plist; - ap_array_header_t *keys; + const ap_array_header_t *keys; int i; keys = ap_table_elts(table); @@ -110,7 +110,7 @@ static PyObject *ap_table_t_items(ap_table_t *table){ PyObject *plist; - ap_array_header_t *keys; + const ap_array_header_t *keys; int i; keys = ap_table_elts(table); =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/conn_rec.i,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- conn_rec.i 2001/04/30 14:29:43 1.18 +++ conn_rec.i 2002/01/07 06:35:18 1.19 @@ -72,13 +72,16 @@ Py_BEGIN_ALLOW_THREADS #ifdef APACHE13 res = *nwrote = ap_bwrite(c->client, lbuf->data, lbuf->len); + Py_END_ALLOW_THREADS + /* we don't PyMem_DEL lbuf->data, as it is ref'd from Python's memory */ + PyMem_DEL(lbuf); #else - *nwrote = lbuf->len; - res = apr_send(c->client_socket, lbuf->data, nwrote); -#endif + PyErr_SetString(PyExc_SystemError, "operation unsupported in Apache 2.0"); Py_END_ALLOW_THREADS /* we don't PyMem_DEL lbuf->data, as it is ref'd from Python's memory */ PyMem_DEL(lbuf); + res = HTTP_INTERNAL_SERVER_ERROR; +#endif return res; } @@ -104,6 +107,9 @@ static PyObject *conn_rec_read(conn_rec *c, int n_to_read) { +#ifndef APACHE13 + SNAKE20_UNSUP(NULL); +#else ap_status_t err; PyObject *restuple, *pstr; int str_alloced; /* # of bytes allocated in the string pstr */ @@ -130,12 +136,7 @@ } Py_BEGIN_ALLOW_THREADS -#ifdef APACHE13 njust_read = err = ap_bread(c->client, buf + num_read, bytes_left); -#else - njust_read = bytes_left; - err = apr_recv(c->client_socket, buf + num_read, &njust_read); -#endif Py_END_ALLOW_THREADS num_read += njust_read; if(err != APR_SUCCESS) @@ -156,6 +157,7 @@ restuple = Py_BuildValue("(iiO)", err, num_read, pstr); Py_DECREF(pstr); return restuple; +#endif } static long conn_rec_id_get(conn_rec *c){ =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/mod_snake.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- mod_snake.c 2001/02/12 01:34:51 1.28 +++ mod_snake.c 2002/01/07 06:35:18 1.29 @@ -67,12 +67,12 @@ static -void mod_snake_common_post_cfg(ap_pool_t *ap_cfg, ap_pool_t *plog, - ap_pool_t *ptemp, server_rec *s) +int mod_snake_common_post_cfg(ap_pool_t *ap_cfg, ap_pool_t *plog, + ap_pool_t *ptemp, server_rec *s) { ModSnakeSCfg *cfg = mod_snake_get_svr_cfg(s); char *server_string = PACKAGE "/" VERSION; - int i; + int i, rc; #ifndef APACHE13 ap_add_version_component(ap_cfg, server_string); @@ -84,8 +84,11 @@ ModSnakePyMod *pymod = (ModSnakePyMod *)Modules->elts + i; if(!pymod->hooks[SNAKE_HOOK_POST_CONFIG]) continue; - mod_snake_run_hook_post_config(pymod, cfg); + if((rc = mod_snake_run_hook_post_config(pymod, cfg)) != OK && + rc != DECLINED) + return rc; } + return OK; } /* @@ -95,10 +98,10 @@ #ifndef APACHE13 static -void mod_snake_post_cfg_cb(ap_pool_t *p, ap_pool_t *plog, - ap_pool_t *ptemp, server_rec *s) +int mod_snake_post_cfg_cb(ap_pool_t *p, ap_pool_t *plog, + ap_pool_t *ptemp, server_rec *s) { - mod_snake_common_post_cfg(p, plog, ptemp, s); + return mod_snake_common_post_cfg(p, plog, ptemp, s); } #endif @@ -505,13 +508,20 @@ apr_hash_index_t *hi; void *val; - for(hi=apr_hash_first(pymod->input_filters); hi; hi=apr_hash_next(hi)){ + for(hi=apr_hash_first(pymod->ap_p, pymod->input_filters); + hi; + hi=apr_hash_next(hi)) + { ModSnakeRegFilter *rfilter; apr_hash_this(hi, NULL, NULL, &val); rfilter = (ModSnakeRegFilter *)val; Py_DECREF(rfilter->func); } - for(hi=apr_hash_first(pymod->output_filters); hi; hi=apr_hash_next(hi)){ + + for(hi=apr_hash_first(pymod->ap_p, pymod->output_filters); + hi; + hi=apr_hash_next(hi)) + { ModSnakeRegFilter *rfilter; apr_hash_this(hi, NULL, NULL, &val); rfilter = (ModSnakeRegFilter *)val; @@ -535,7 +545,7 @@ const char *module_name, int is_profile) { ModSnakePyMod *pymod = ap_push_array(modulelist); - ap_pool_t *ap_p = AP_ARRAY_POOL(modulelist); + ap_pool_t *ap_p = modulelist->pool; int i; MS_TRACE; @@ -638,18 +648,21 @@ } static -void mod_snake_open_logs_cb(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptmp, - server_rec *s) +int mod_snake_open_logs_cb(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptmp, + server_rec *s) { ModSnakeSCfg *cfg = mod_snake_get_svr_cfg(s); - int i; + int i, rc; for(i=0; i< Modules->nelts; i++){ ModSnakePyMod *pymod = (ModSnakePyMod *)Modules->elts + i; if(!pymod->hooks[SNAKE_HOOK_OPEN_LOGS]) continue; - mod_snake_run_hook_open_logs(pymod, cfg); + if((rc = mod_snake_run_hook_open_logs(pymod, cfg)) != OK && + rc != DECLINED) + return rc; } + return OK; } #ifdef APACHE13 =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/mod_snake.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -3 -r1.29 -r1.30 --- mod_snake.h 2001/02/12 01:34:51 1.29 +++ mod_snake.h 2002/01/07 06:35:18 1.30 @@ -28,6 +28,7 @@ #include "apr_network_io.h" #include "apr_strings.h" #include "apr_hash.h" +#include "apr_uri.h" #endif #include "snake_precompile.h" #include <sys/param.h> @@ -234,12 +235,6 @@ #endif #ifdef APACHE13 -#define AP_ARRAY_POOL(p) (p)->pool -#else -#define AP_ARRAY_POOL(p) (p)->cont -#endif - -#ifdef APACHE13 #define AP_CLEANUP_RESTYPE void #define AP_CLEANUP_RESULT(x) #else @@ -318,10 +313,10 @@ extern int mod_snake_hooknum_to_type(int hookno); extern int mod_snake_hookname_to_num(const char *hookname); extern const char *mod_snake_hooknum_to_name(int hookno); -extern void mod_snake_run_hook_post_config(ModSnakePyMod *pymod, - ModSnakeSCfg *scfg); -extern void mod_snake_run_hook_open_logs(ModSnakePyMod *pymod, - ModSnakeSCfg *scfg); +extern int mod_snake_run_hook_post_config(ModSnakePyMod *pymod, + ModSnakeSCfg *scfg); +extern int mod_snake_run_hook_open_logs(ModSnakePyMod *pymod, + ModSnakeSCfg *scfg); extern void mod_snake_log_error_unformat(const char *file, int line, int level, ap_status_t status, const server_rec *s, =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/mod_snake_buf.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- mod_snake_buf.c 2001/02/10 09:08:46 1.4 +++ mod_snake_buf.c 2002/01/07 06:35:18 1.5 @@ -83,7 +83,7 @@ apr_bucket *mod_snake_buf_bucketize(ModSnakeBuf *buf){ apr_bucket *res; - res = apr_bucket_heap_create(buf->data, buf->endp - buf->data, 0, NULL); + res = apr_bucket_heap_create(buf->data, buf->endp - buf->data, 0); if(!res) return NULL; free(buf); return res; =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/request_rec.i,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- request_rec.i 2001/05/28 20:33:45 1.30 +++ request_rec.i 2002/01/07 06:35:18 1.31 @@ -84,6 +84,14 @@ #endif } +static char *request_rec_content_language_get(request_rec *obj){ +#ifdef APACHE13 + return obj->content_language; +#else + SNAKE20_UNSUP(NULL); +#endif +} + static char *request_rec_content_type_get(request_rec *obj){ return (char *)obj->content_type; } @@ -551,7 +559,9 @@ %readonly char *handler; - char *content_language; + %addmethods { + char *content_language; + } ap_array_header_t *content_languages; char *vlist_validator; @@ -573,6 +583,6 @@ %addmethods { PyObject *finfo; } - apr_uri_components parsed_uri; + apr_uri_t parsed_uri; } request_rec; =================================================================== RCS file: /cvsroot/modsnake/mod_snake/src/snake_modules.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- snake_modules.c 2001/05/28 20:31:39 1.28 +++ snake_modules.c 2002/01/07 06:35:18 1.29 @@ -278,10 +278,8 @@ initmod_snakec(); if(mod_snake_initmod_internal("mod_snake", &Mod_Snake_Py) == -1){ - if(PyErr_Occurred()) - PyErr_Print(); mod_snake_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, 0, s, - "mod_snake: Error initializing internal mod_snakea!"); + "mod_snake: Error initializing internal mod_snake!"); if(PyErr_Occurred()) PyErr_Print(); Py_EndInterpreter(thr); @@ -696,16 +694,17 @@ return res; } -void mod_snake_run_hook_post_config(ModSnakePyMod *pymod, ModSnakeSCfg *scfg){ +int mod_snake_run_hook_post_config(ModSnakePyMod *pymod, ModSnakeSCfg *scfg){ PyObject *pargs, *pres, *per_svr_data; PyThreadState *tstate; + int res; /* Lock */ if((tstate = mod_snake_create_thread_and_lock(pymod->interp)) == NULL){ mod_snake_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, 0, mod_snake_get_main_server(), "mod_snake: Failed to create a new threadstate"); - return; + return HTTP_INTERNAL_SERVER_ERROR; } if(!(per_svr_data = mod_snake_find_svr_cback_data(pymod, scfg))) @@ -715,25 +714,34 @@ pres =mod_snake_pyeval_callobject(pymod,pymod->hooks[SNAKE_HOOK_POST_CONFIG], pargs,SNAKE_HOOK_POST_CONFIG);/* Incref */ Py_DECREF(pargs); - if(pres == NULL){ + if(pres == NULL || !PyInt_Check(pres)){ + mod_snake_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, 0,scfg->server, + "mod_snake: (%s) Failed to call post_cfg hook", + pymod->name); + if(!PyErr_Occurred() && !PyInt_Check(pres)) + PyErr_SetString(PyExc_TypeError, "Return value not an int"); if(PyErr_Occurred()) PyErr_Print(); - } else - Py_DECREF(pres); /* Discard the result */ + res = HTTP_INTERNAL_SERVER_ERROR; + } else { + res = PyInt_AsLong(pres); + Py_DECREF(pres); + } mod_snake_destroy_thread_and_unlock(tstate); /* Unlock */ - return; + return res; } -void mod_snake_run_hook_open_logs(ModSnakePyMod *pymod, ModSnakeSCfg *scfg){ +int mod_snake_run_hook_open_logs(ModSnakePyMod *pymod, ModSnakeSCfg *scfg){ PyObject *pargs, *pres, *ppymod, *per_svr_data; PyThreadState *tstate; + int res; /* Lock */ if((tstate = mod_snake_create_thread_and_lock(pymod->interp)) == NULL){ mod_snake_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, 0, mod_snake_get_main_server(), "mod_snake: Failed to create a new threadstate"); - return; + return HTTP_INTERNAL_SERVER_ERROR; } ppymod = mod_snake_get_modsnakepymod_shadowclass(pymod); @@ -745,13 +753,21 @@ pres = mod_snake_pyeval_callobject(pymod, pymod->hooks[SNAKE_HOOK_OPEN_LOGS], pargs, SNAKE_HOOK_OPEN_LOGS); /* Incref */ Py_DECREF(pargs); - if(pres == NULL){ + if(pres == NULL || !PyInt_Check(pres)){ + mod_snake_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, 0,scfg->server, + "mod_snake: (%s) Failed to call open_logs hook", + pymod->name); + if(!PyErr_Occurred() && !PyInt_Check(pres)) + PyErr_SetString(PyExc_TypeError, "Return value not an int"); if(PyErr_Occurred()) PyErr_Print(); - } else - Py_DECREF(pres); /* Discard the result */ + res = HTTP_INTERNAL_SERVER_ERROR; + } else { + res = PyInt_AsLong(pres); + Py_DECREF(pres); + } mod_snake_destroy_thread_and_unlock(tstate); /* Unlock */ - return; + return res; } |