You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@apache.org on 2001/04/06 04:18:17 UTC
cvs commit: modperl-2.0/src/modules/perl mod_perl.c modperl_callback.c modperl_cmd.c modperl_cmd.h modperl_config.c modperl_interp.c modperl_interp.h modperl_types.h
dougm 01/04/05 19:18:16
Modified: src/modules/perl mod_perl.c modperl_callback.c modperl_cmd.c
modperl_cmd.h modperl_config.c modperl_interp.c
modperl_interp.h modperl_types.h
Log:
rename PerlInterpLifetime to PerlInterpScope
Revision Changes Path
1.42 +4 -4 modperl-2.0/src/modules/perl/mod_perl.c
Index: mod_perl.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- mod_perl.c 2001/04/04 05:12:54 1.41
+++ mod_perl.c 2001/04/06 02:18:15 1.42
@@ -163,8 +163,8 @@
#ifdef MP_TRACE
char *name = modperl_server_desc(s, p);
- MP_TRACE_i(MP_FUNC, "PerlInterpLifetime set to %s for %s\n",
- modperl_interp_lifetime_desc(scfg->interp_lifetime), name);
+ MP_TRACE_i(MP_FUNC, "PerlInterpScope set to %s for %s\n",
+ modperl_interp_scope_desc(scfg->interp_scope), name);
#else
char *name = NULL;
#endif /* MP_TRACE */
@@ -257,8 +257,8 @@
"Min number of spare Perl interpreters"),
MP_CMD_SRV_TAKE1("PerlInterpMaxRequests", interp_max_requests,
"Max number of requests per Perl interpreters"),
- MP_CMD_DIR_TAKE1("PerlInterpLifetime", interp_lifetime,
- "Lifetime of a Perl interpreter"),
+ MP_CMD_DIR_TAKE1("PerlInterpScope", interp_scope,
+ "Scope of a Perl interpreter"),
#endif
MP_CMD_ENTRIES,
{ NULL },
1.38 +2 -2 modperl-2.0/src/modules/perl/modperl_callback.c
Index: modperl_callback.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- modperl_callback.c 2001/04/03 05:23:47 1.37
+++ modperl_callback.c 2001/04/06 02:18:15 1.38
@@ -144,7 +144,7 @@
}
#ifdef USE_ITHREADS
- if (r && !c && modperl_interp_lifetime_connection(scfg)) {
+ if (r && !c && modperl_interp_scope_connection(scfg)) {
c = r->connection;
}
if (r || c) {
@@ -200,7 +200,7 @@
#ifdef USE_ITHREADS
if (interp && MpInterpPUTBACK(interp)) {
- /* PerlInterpLifetime handler */
+ /* PerlInterpScope handler */
modperl_interp_unselect(interp);
}
#endif
1.4 +16 -16 modperl-2.0/src/modules/perl/modperl_cmd.c
Index: modperl_cmd.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- modperl_cmd.c 2001/03/25 17:42:26 1.3
+++ modperl_cmd.c 2001/04/06 02:18:15 1.4
@@ -69,53 +69,53 @@
#ifdef USE_ITHREADS
-#define MP_INTERP_LIFETIME_USAGE "PerlInterpLifetime must be one of "
+#define MP_INTERP_SCOPE_USAGE "PerlInterpScope must be one of "
-#define MP_INTERP_LIFETIME_DIR_OPTS \
+#define MP_INTERP_SCOPE_DIR_OPTS \
"handler, subrequest or request"
-#define MP_INTERP_LIFETIME_DIR_USAGE \
-MP_INTERP_LIFETIME_USAGE MP_INTERP_LIFETIME_DIR_OPTS
+#define MP_INTERP_SCOPE_DIR_USAGE \
+MP_INTERP_SCOPE_USAGE MP_INTERP_SCOPE_DIR_OPTS
-#define MP_INTERP_LIFETIME_SRV_OPTS \
-"connection, " MP_INTERP_LIFETIME_DIR_OPTS
+#define MP_INTERP_SCOPE_SRV_OPTS \
+"connection, " MP_INTERP_SCOPE_DIR_OPTS
-#define MP_INTERP_LIFETIME_SRV_USAGE \
-MP_INTERP_LIFETIME_USAGE MP_INTERP_LIFETIME_SRV_OPTS
+#define MP_INTERP_SCOPE_SRV_USAGE \
+MP_INTERP_SCOPE_USAGE MP_INTERP_SCOPE_SRV_OPTS
-MP_CMD_SRV_DECLARE(interp_lifetime)
+MP_CMD_SRV_DECLARE(interp_scope)
{
- modperl_interp_lifetime_e *lifetime;
+ modperl_interp_scope_e *scope;
modperl_config_dir_t *dcfg = (modperl_config_dir_t *)dummy;
MP_dSCFG(parms->server);
int is_per_dir = parms->path ? 1 : 0;
- lifetime = is_per_dir ? &dcfg->interp_lifetime : &scfg->interp_lifetime;
+ scope = is_per_dir ? &dcfg->interp_scope : &scfg->interp_scope;
switch (toLOWER(*arg)) {
case 'h':
if (strcaseEQ(arg, "handler")) {
- *lifetime = MP_INTERP_LIFETIME_HANDLER;
+ *scope = MP_INTERP_SCOPE_HANDLER;
break;
}
case 's':
if (strcaseEQ(arg, "subrequest")) {
- *lifetime = MP_INTERP_LIFETIME_SUBREQUEST;
+ *scope = MP_INTERP_SCOPE_SUBREQUEST;
break;
}
case 'r':
if (strcaseEQ(arg, "request")) {
- *lifetime = MP_INTERP_LIFETIME_REQUEST;
+ *scope = MP_INTERP_SCOPE_REQUEST;
break;
}
case 'c':
if (!is_per_dir && strcaseEQ(arg, "connection")) {
- *lifetime = MP_INTERP_LIFETIME_CONNECTION;
+ *scope = MP_INTERP_SCOPE_CONNECTION;
break;
}
default:
return is_per_dir ?
- MP_INTERP_LIFETIME_DIR_USAGE : MP_INTERP_LIFETIME_SRV_USAGE;
+ MP_INTERP_SCOPE_DIR_USAGE : MP_INTERP_SCOPE_SRV_USAGE;
};
return NULL;
1.4 +11 -11 modperl-2.0/src/modules/perl/modperl_cmd.h
Index: modperl_cmd.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- modperl_cmd.h 2001/03/25 18:20:11 1.3
+++ modperl_cmd.h 2001/04/06 02:18:15 1.4
@@ -18,22 +18,22 @@
MP_CMD_SRV_DECLARE(interp_max_spare);
MP_CMD_SRV_DECLARE(interp_min_spare);
MP_CMD_SRV_DECLARE(interp_max_requests);
-MP_CMD_SRV_DECLARE(interp_lifetime);
+MP_CMD_SRV_DECLARE(interp_scope);
-#define modperl_interp_lifetime_undef(dcfg) \
-(dcfg->interp_lifetime == MP_INTERP_LIFETIME_UNDEF)
+#define modperl_interp_scope_undef(dcfg) \
+(dcfg->interp_scope == MP_INTERP_SCOPE_UNDEF)
-#define modperl_interp_lifetime_handler(dcfg) \
-(dcfg->interp_lifetime == MP_INTERP_LIFETIME_HANDLER)
+#define modperl_interp_scope_handler(dcfg) \
+(dcfg->interp_scope == MP_INTERP_SCOPE_HANDLER)
-#define modperl_interp_lifetime_subrequest(dcfg) \
-(dcfg->interp_lifetime == MP_INTERP_LIFETIME_SUBREQUEST)
+#define modperl_interp_scope_subrequest(dcfg) \
+(dcfg->interp_scope == MP_INTERP_SCOPE_SUBREQUEST)
-#define modperl_interp_lifetime_request(scfg) \
-(scfg->interp_lifetime == MP_INTERP_LIFETIME_REQUEST)
+#define modperl_interp_scope_request(scfg) \
+(scfg->interp_scope == MP_INTERP_SCOPE_REQUEST)
-#define modperl_interp_lifetime_connection(scfg) \
-(scfg->interp_lifetime == MP_INTERP_LIFETIME_CONNECTION)
+#define modperl_interp_scope_connection(scfg) \
+(scfg->interp_scope == MP_INTERP_SCOPE_CONNECTION)
#endif
1.31 +5 -5 modperl-2.0/src/modules/perl/modperl_config.c
Index: modperl_config.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- modperl_config.c 2001/04/04 05:12:54 1.30
+++ modperl_config.c 2001/04/06 02:18:15 1.31
@@ -5,8 +5,8 @@
modperl_config_dir_t *dcfg = modperl_config_dir_new(p);
#ifdef USE_ITHREADS
- /* defaults to per-server lifetime */
- dcfg->interp_lifetime = MP_INTERP_LIFETIME_UNDEF;
+ /* defaults to per-server scope */
+ dcfg->interp_scope = MP_INTERP_SCOPE_UNDEF;
#endif
return dcfg;
@@ -37,7 +37,7 @@
(unsigned long)basev, (unsigned long)addv);
#ifdef USE_ITHREADS
- merge_item(interp_lifetime);
+ merge_item(interp_scope);
#endif
mrg->flags = modperl_options_merge(p, base->flags, add->flags);
@@ -125,7 +125,7 @@
(modperl_tipool_config_t *)
apr_pcalloc(p, sizeof(*scfg->interp_pool_cfg));
- scfg->interp_lifetime = MP_INTERP_LIFETIME_REQUEST;
+ scfg->interp_scope = MP_INTERP_SCOPE_REQUEST;
/* XXX: determine reasonable defaults */
scfg->interp_pool_cfg->start = 3;
@@ -155,7 +155,7 @@
#ifdef USE_ITHREADS
merge_item(mip);
merge_item(interp_pool_cfg);
- merge_item(interp_lifetime);
+ merge_item(interp_scope);
#else
merge_item(perl);
#endif
1.30 +17 -17 modperl-2.0/src/modules/perl/modperl_interp.c
Index: modperl_interp.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- modperl_interp.c 2001/03/26 00:36:39 1.29
+++ modperl_interp.c 2001/04/06 02:18:15 1.30
@@ -7,13 +7,13 @@
#ifdef USE_ITHREADS
-static const char *MP_interp_lifetime_desc[] = {
+static const char *MP_interp_scope_desc[] = {
"undef", "handler", "subrequest", "request", "connection",
};
-const char *modperl_interp_lifetime_desc(modperl_interp_lifetime_e lifetime)
+const char *modperl_interp_scope_desc(modperl_interp_scope_e scope)
{
- return MP_interp_lifetime_desc[lifetime];
+ return MP_interp_scope_desc[scope];
}
modperl_interp_t *modperl_interp_new(apr_pool_t *p,
@@ -206,7 +206,7 @@
}
/* XXX:
- * interp is marked as in_use for the lifetime of the pool it is
+ * interp is marked as in_use for the scope of the pool it is
* stashed in. this is done to avoid the tipool->tlock whenever
* possible. neither approach is ideal.
*/
@@ -224,7 +224,7 @@
modperl_interp_t *interp = NULL;
apr_pool_t *p = NULL;
int is_subrequest = (r && r->main) ? 1 : 0;
- modperl_interp_lifetime_e lifetime;
+ modperl_interp_scope_e scope;
if (!scfg->threaded_mpm) {
MP_TRACE_i(MP_FUNC,
@@ -237,23 +237,23 @@
}
/*
- * if a per-dir PerlInterpLifetime is specified, use it.
- * else if r != NULL use per-server PerlInterpLifetime
- * else lifetime must be per-connection
+ * if a per-dir PerlInterpScope is specified, use it.
+ * else if r != NULL use per-server PerlInterpScope
+ * else scope must be per-connection
*/
- lifetime = (dcfg && !modperl_interp_lifetime_undef(dcfg)) ?
- dcfg->interp_lifetime :
- (r ? scfg->interp_lifetime : MP_INTERP_LIFETIME_CONNECTION);
+ scope = (dcfg && !modperl_interp_scope_undef(dcfg)) ?
+ dcfg->interp_scope :
+ (r ? scfg->interp_scope : MP_INTERP_SCOPE_CONNECTION);
- MP_TRACE_i(MP_FUNC, "lifetime is per-%s\n",
- modperl_interp_lifetime_desc(lifetime));
+ MP_TRACE_i(MP_FUNC, "scope is per-%s\n",
+ modperl_interp_scope_desc(scope));
/*
- * XXX: goto modperl_interp_get() if lifetime == handler ?
+ * XXX: goto modperl_interp_get() if scope == handler ?
*/
- if (c && (lifetime == MP_INTERP_LIFETIME_CONNECTION)) {
+ if (c && (scope == MP_INTERP_SCOPE_CONNECTION)) {
desc = "conn_rec pool";
get_interp(c->pool);
@@ -267,7 +267,7 @@
p = c->pool;
}
else if (r) {
- if (is_subrequest && (lifetime == MP_INTERP_LIFETIME_REQUEST)) {
+ if (is_subrequest && (scope == MP_INTERP_SCOPE_REQUEST)) {
/* share 1 interpreter across sub-requests */
request_rec *main_r = r->main;
@@ -311,7 +311,7 @@
interp = modperl_interp_get(s ? s : r->server);
++interp->num_requests; /* should only get here once per request */
- if (lifetime == MP_INTERP_LIFETIME_HANDLER) {
+ if (scope == MP_INTERP_SCOPE_HANDLER) {
/* caller is responsible for calling modperl_interp_unselect() */
MpInterpPUTBACK_On(interp);
}
1.10 +1 -1 modperl-2.0/src/modules/perl/modperl_interp.h
Index: modperl_interp.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- modperl_interp.h 2001/03/16 05:52:29 1.9
+++ modperl_interp.h 2001/04/06 02:18:15 1.10
@@ -7,7 +7,7 @@
apr_status_t modperl_interp_cleanup(void *data);
#ifdef USE_ITHREADS
-const char *modperl_interp_lifetime_desc(modperl_interp_lifetime_e lifetime);
+const char *modperl_interp_scope_desc(modperl_interp_scope_e scope);
modperl_interp_t *modperl_interp_new(apr_pool_t *p,
modperl_interp_pool_t *mip,
1.33 +8 -8 modperl-2.0/src/modules/perl/modperl_types.h
Index: modperl_types.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- modperl_types.h 2001/04/04 17:12:07 1.32
+++ modperl_types.h 2001/04/06 02:18:15 1.33
@@ -99,12 +99,12 @@
} modperl_options_t;
typedef enum {
- MP_INTERP_LIFETIME_UNDEF,
- MP_INTERP_LIFETIME_HANDLER,
- MP_INTERP_LIFETIME_SUBREQUEST,
- MP_INTERP_LIFETIME_REQUEST,
- MP_INTERP_LIFETIME_CONNECTION,
-} modperl_interp_lifetime_e;
+ MP_INTERP_SCOPE_UNDEF,
+ MP_INTERP_SCOPE_HANDLER,
+ MP_INTERP_SCOPE_SUBREQUEST,
+ MP_INTERP_SCOPE_REQUEST,
+ MP_INTERP_SCOPE_CONNECTION,
+} modperl_interp_scope_e;
typedef struct {
MpHV *SetVars;
@@ -118,7 +118,7 @@
#ifdef USE_ITHREADS
modperl_interp_pool_t *mip;
modperl_tipool_config_t *interp_pool_cfg;
- modperl_interp_lifetime_e interp_lifetime;
+ modperl_interp_scope_e interp_scope;
#else
PerlInterpreter *perl;
#endif
@@ -137,7 +137,7 @@
MpHV *SetVars;
modperl_options_t *flags;
#ifdef USE_ITHREADS
- modperl_interp_lifetime_e interp_lifetime;
+ modperl_interp_scope_e interp_scope;
#endif
} modperl_config_dir_t;