|
|
Choosing A Webhost: |
[patch] Apache->server->pool: msg#00113apache.mod-perl.devel
hi... from compat.pod, the way to access per-server cleanups is $s->pool->cleanup_register(\&cleanup_callback, $data); which is similar to per-request cleanups $r->pool->cleanup_register(\&cleanup_callback, $data); all is cool so far. the problem is that there is no pool() method in Apache::Server or Apache::ServerUtil, so you can't actually use cleanup_register() as documented for per-server cleanups. anyway, here is a patch that seems to fit the bill. well, almost. it implements Apache->server->pool(), which you can now use to register cleanups via Apache->server->pool->cleanup_register(). all tests pass. the only problem is one that is difficult to check via the test suite. any registered per-server cleanups don't actually get run. ever. they just vanish. I verified this via some test debugging (using the cleanup to touch a file), as well as using Apache->server->pool->cleanup_register() in a module I'm developing. hmph. at any rate, any insight is appreciated - I really don't know how to proceed from here to get this working. --Geoff Index: t/response/TestAPI/server_util.pm =================================================================== RCS file: /home/cvspublic/modperl-2.0/t/response/TestAPI/server_util.pm,v retrieving revision 1.5 diff -u -r1.5 server_util.pm --- t/response/TestAPI/server_util.pm 11 Apr 2002 11:08:43 -0000 1.5 +++ t/response/TestAPI/server_util.pm 15 Apr 2003 19:31:32 -0000 @@ -16,7 +16,7 @@ my $s = $r->server; - plan $r, tests => 9; + plan $r, tests => 11; for my $p ($r->pool, $r->connection->pool, $r, $r->connection, $r->server) @@ -42,6 +42,11 @@ $dir = Apache->server_root_relative(); #1.x ish ok -d $dir; + + ok $s->pool->isa('APR::Pool'); + + $s->pool->cleanup_register(sub { Apache::OK }); + ok 1; Apache::OK; } Index: xs/Apache/ServerUtil/Apache__ServerUtil.h =================================================================== RCS file: /home/cvspublic/modperl-2.0/xs/Apache/ServerUtil/Apache__ServerUtil.h,v retrieving revision 1.8 diff -u -r1.8 Apache__ServerUtil.h --- xs/Apache/ServerUtil/Apache__ServerUtil.h 19 Nov 2001 23:46:48 -0000 1.8 +++ xs/Apache/ServerUtil/Apache__ServerUtil.h 15 Apr 2003 19:31:32 -0000 @@ -56,3 +56,7 @@ newCONSTSUB(PL_defstash, "Apache::server_root", newSVpv(ap_server_root, 0)); } + +#define mpxs_Apache__Server_pool(s) \ + modperl_server_pool() + Index: xs/maps/modperl_functions.map =================================================================== RCS file: /home/cvspublic/modperl-2.0/xs/maps/modperl_functions.map,v retrieving revision 1.56 diff -u -r1.56 modperl_functions.map --- xs/maps/modperl_functions.map 1 Apr 2003 05:20:50 -0000 1.56 +++ xs/maps/modperl_functions.map 15 Apr 2003 19:31:32 -0000 @@ -68,6 +68,7 @@ PACKAGE=Apache::Server SV *:DEFINE_dir_config | | server_rec *:s, char *:key=NULL, SV *:sv_val=Nullsv + apr_pool_t:DEFINE_pool | | server_rec *:s PACKAGE=Apache server_rec *:DEFINE_server | | SV *:classname=Nullsv --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxxx For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [patch] s/APR::URI::default_port_for_scheme/APR::URI::port_of_scheme/, Geoffrey Young |
|---|---|
| Next by Date: | Re: rfc: allowing more than one mod_perl install - s/Apache2.pm/PREFIX+blib/, Randy Kobes |
| Previous by Thread: | RE: Mixed-case environment variables in Win32 don't get handled c orrectly, steve . sparling |
| Next by Thread: | Re: [patch] Apache->server->pool, Stas Bekman |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |