Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[patch] Apache->server->pool: msg#00113

apache.mod-perl.devel

Subject: [patch] Apache->server->pool

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>
Google Custom Search

Recently Viewed:
qplus.devel/200...    network.jabber....    debian.qa-packa...    encryption.gpg....    python.dabo.dev...    uclinux.devel/2...    science.mathema...    recreation.pesc...    kernel.ck/2004-...    mozilla.devel.e...    tex.latex.prosp...    ietf.multi6/200...    bbc.cvs/2002-11...    xfree86.newbie/...    jakarta.taglibs...    altlinux.hardwa...    comedi/2002-05/...    horde.bugs/2004...    games.diplomacy...    finance.e-gold....    web.dom.test-su...    lang.ruby.rails...    os.netbsd.devel...    video.gstreamer...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive 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

Navigation