richter 02/05/23 15:24:47
Modified: . Tag: Embperl2c Embperl.pm Makefile.PL epapinit.c
epinit.c epio.c epmain.c epnames.h eppriv.h
test/conf Tag: Embperl2c httpd.conf.src startup.pl
Log:
cont mod_perl 2
Revision Changes Path
No revision
No revision
1.118.4.107 +2 -3 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.118.4.106
retrieving revision 1.118.4.107
diff -u -r1.118.4.106 -r1.118.4.107
--- Embperl.pm 21 May 2002 07:48:30 -0000 1.118.4.106
+++ Embperl.pm 23 May 2002 22:24:45 -0000 1.118.4.107
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Embperl.pm,v 1.118.4.106 2002/05/21 07:48:30 richter Exp $
+# $Id: Embperl.pm,v 1.118.4.107 2002/05/23 22:24:45 richter Exp $
#
###################################################################################
@@ -59,12 +59,11 @@
}
-
if (!defined(&Embperl::Init))
{
bootstrap Embperl $VERSION;
Boot ($VERSION) ;
- Init ($modperl?Apache -> server:undef, \%initparam) ;
+ Init ($modperl?(defined(&Apache::ServerUtil::server)?Apache::ServerUtil ->
server:Apache -> server):undef, \%initparam) ;
}
$cwd = Cwd::fastcwd();
1.31.4.55 +2 -1 embperl/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/embperl/Makefile.PL,v
retrieving revision 1.31.4.54
retrieving revision 1.31.4.55
diff -u -r1.31.4.54 -r1.31.4.55
--- Makefile.PL 23 May 2002 07:54:47 -0000 1.31.4.54
+++ Makefile.PL 23 May 2002 22:24:45 -0000 1.31.4.55
@@ -3,7 +3,7 @@
#
# (C) 1997-2001 G.Richter ([EMAIL PROTECTED]) / ECOS
#
-# $Id: Makefile.PL,v 1.31.4.54 2002/05/23 07:54:47 richter Exp $
+# $Id: Makefile.PL,v 1.31.4.55 2002/05/23 22:24:45 richter Exp $
#
@@ -1025,6 +1025,7 @@
print FH "\$EPSESSIONVERSION='$SessVer';\n" ;
print FH "\$EPSESSIONXVERSION='$SessXVer';\n" ;
print FH "\$EP2='$EP2';\n" ;
+ print FH "\$MP2='". ($mp2cfg?'1':'0') . "';\n" ;
print FH "\$EPMODPERLVERSION='$MPVer';\n" ;
print FH "\$EPC_ENABLE='$epc_enable';\n" ;
print FH "\$EPNOAPACHELIB='$EPNOAPACHELIB';\n" ;
1.1.2.38 +108 -69 embperl/epapinit.c
Index: epapinit.c
===================================================================
RCS file: /home/cvs/embperl/epapinit.c,v
retrieving revision 1.1.2.37
retrieving revision 1.1.2.38
diff -u -r1.1.2.37 -r1.1.2.38
--- epapinit.c 23 May 2002 07:54:48 -0000 1.1.2.37
+++ epapinit.c 23 May 2002 22:24:45 -0000 1.1.2.38
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epapinit.c,v 1.1.2.37 2002/05/23 07:54:48 richter Exp $
+# $Id: epapinit.c,v 1.1.2.38 2002/05/23 22:24:45 richter Exp $
#
###################################################################################*/
@@ -24,6 +24,8 @@
#ifdef APACHE
#include <http_core.h>
+#include <apr_dso.h>
+#include <dlfcn.h>
#ifndef gettid
#ifdef WIN32
@@ -42,7 +44,7 @@
/* define config prototypes */
#ifdef APACHE2
-static void embperl_ApacheInit (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
server_rec *s) ;
+static int embperl_ApacheInit (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
server_rec *s) ;
static apr_status_t embperl_ApacheInitCleanup (void * p) ;
#else
static void embperl_ApacheInitCleanup (void * p) ;
@@ -92,7 +94,7 @@
#define EPCFG_SAVE EPCFG
#undef EPCFG
#define EPCFG(STRUCT,TYPE,NAME,CFGNAME) \
- char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd,
/*tApacheDirConfig*/ void * pDirCfg, const char * arg) ;
+ const char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd,
/*tApacheDirConfig*/ void * pDirCfg, const char * arg) ;
#include "epcfg.h"
@@ -110,7 +112,7 @@
#define EPCFG(STRUCT,TYPE,NAME,CFGNAME) \
AP_INIT_TAKE1( "EMBPERL_"#CFGNAME, embperl_Apache_Config_##STRUCT##NAME,
NULL, RSRC_CONF | OR_OPTIONS, "" ),
-static char * embperl_Apache_Config_useenv (cmd_parms *cmd, /*tApacheDirConfig*/
void * pDirCfg, bool arg) ;
+static const char * embperl_Apache_Config_useenv (cmd_parms *cmd,
/*tApacheDirConfig*/ void * pDirCfg, int arg) ;
static void *embperl_create_dir_config(apr_pool_t *p, char *d) ;
static void *embperl_create_server_config(apr_pool_t *p, server_rec *s) ;
static void *embperl_merge_dir_config (apr_pool_t *p, void *basev, void *addv) ;
@@ -133,7 +135,7 @@
}
-static module AP_MODULE_DECLARE_DATA embperl_module =
+module AP_MODULE_DECLARE_DATA embperl_module =
{
STANDARD20_MODULE_STUFF,
embperl_create_dir_config, /* dir config creater */
@@ -176,15 +178,44 @@
-void embperl_ApacheAddModule (apr_pool_t * pool)
+void embperl_ApacheAddModule (void)
{
+ apr_pool_t * pool ;
+
+ /*
+ apr_dso_handle_sym_t ressym ;
+ apr_dso_handle_t handle ;
+
+ memset (handle, 0, sizeof(handle)) ;
+
+ if (apr_dso_sym (&ressym, &handle, "apr_global_hook_pool") != APR_SUCCESS)
+ {
+ ap_log_error (APLOG_MARK, APLOG_ERR, 0, NULL, "Embperl: Cannot get address
of apr_global_hook_pool [%d/%d]\n", getpid(), gettid()) ;
+ return ;
+ }
+
+ pool = *((apr_pool_t * *)(ressym)) ;
+ */
+
+#ifdef APACHE2
+ void * p = dlsym (0, "apr_global_hook_pool") ;
+
+ if (!p)
+ {
+ ap_log_error (APLOG_MARK, APLOG_ERR, 0, NULL, "Embperl: Cannot get address
of apr_global_hook_pool [%d/%d]\n", getpid(), gettid()) ;
+ return ;
+ }
+
+ pool = *((apr_pool_t * *)(p)) ;
+#endif
+
bApDebug = ap_exists_config_define("EMBPERL_APDEBUG") ;
if (!ap_find_linked_module("embperl.c"))
{
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
About to add embperl.c as dynamic module [%d/%d]\n", getpid(), gettid()) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: About to add embperl.c as dynamic module [%d/%d]\n", getpid(), gettid()) ;
embperl_module.name = "embperl.c" ;
#ifdef APACHE2
@@ -195,40 +226,43 @@
}
else
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
embperl.c already added as dynamic module [%d/%d]\n", getpid(), gettid()) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: embperl.c already added as dynamic module [%d/%d]\n", getpid(), gettid()) ;
}
#ifdef APACHE2
-static void embperl_ApacheInit (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
server_rec *s)
+static int embperl_ApacheInit (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
server_rec *s)
#else
static void embperl_ApacheInit (server_rec *s, apr_pool_t *p)
#endif
{
int rc ;
+ dTHX ;
#ifdef APACHE2
apr_pool_t * subpool ;
apr_pool_sub_make(&subpool, p, NULL);
#else
- pool * subpool = ap_make_sub_pool(p);
+ apr_pool_t * subpool = ap_make_sub_pool(p);
#endif
- dTHX ;
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
ApacheInit [%d/%d]\n", getpid(), gettid()) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL, "Embperl:
ApacheInit [%d/%d]\n", getpid(), gettid()) ;
ap_register_cleanup(subpool, NULL, embperl_ApacheInitCleanup,
embperl_ApacheInitCleanup);
#ifdef APACHE2
- ap_add_version_component ("Embperl/"VERSION) ;
-#else
ap_add_version_component (p, "Embperl/"VERSION) ;
+#else
+ ap_add_version_component ("Embperl/"VERSION) ;
#endif
if ((rc = embperl_Init (aTHX_ NULL, NULL, s)) != ok)
{
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL,
"Initialization of Embperl failed (#%d)\n", rc) ;
+ ap_log_error (APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, NULL,
"Initialization of Embperl failed (#%d)\n", rc) ;
}
+#ifdef APACHE2
+ return APR_SUCCESS ;
+#endif
}
@@ -246,25 +280,29 @@
if (m -> dynamic_load_handle)
{
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL,
"Embperl: ApacheInitCleanup: mod_perl.c dynamicly loaded -> remove embperl.c
[%d/%d]\n", getpid(), gettid()) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: ApacheInitCleanup: mod_perl.c dynamicly loaded -> remove embperl.c
[%d/%d]\n", getpid(), gettid()) ;
ap_remove_module (&embperl_module) ;
}
else
+ {
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL,
"Embperl: ApacheInitCleanup: mod_perl.c not dynamic loaded [%d/%d]\n", getpid(),
gettid()) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: ApacheInitCleanup: mod_perl.c not dynamic loaded [%d/%d]\n", getpid(),
gettid()) ;
+ }
}
else
+ {
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
ApacheInitCleanup: mod_perl.c not found [%d/%d]\n", getpid(), gettid()) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: ApacheInitCleanup: mod_perl.c not found [%d/%d]\n", getpid(), gettid()) ;
+ }
#ifdef APACHE2
- return APR_SUCCESS ;
+ return OK ;
#endif
}
-static void *embperl_create_dir_config(pool *p, char *d)
+static void *embperl_create_dir_config(apr_pool_t * p, char *d)
{
tApacheDirConfig *cfg = (tApacheDirConfig *) ap_pcalloc(p,
sizeof(tApacheDirConfig));
@@ -274,14 +312,14 @@
cfg -> bUseEnv = -1 ;
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
create_dir_config [%d/%d]\n", getpid(), gettid()) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL, "Embperl:
create_dir_config [%d/%d]\n", getpid(), gettid()) ;
return cfg;
}
-static void *embperl_create_server_config(pool *p, server_rec *s)
+static void *embperl_create_server_config(apr_pool_t * p, server_rec *s)
{
tApacheDirConfig *cfg = (tApacheDirConfig *) ap_pcalloc(p,
sizeof(tApacheDirConfig));
@@ -291,12 +329,13 @@
cfg -> bUseEnv = -1 ;
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
create_server_config [%d/%d]\n", getpid(), gettid()) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL, "Embperl:
create_server_config [%d/%d]\n", getpid(), gettid()) ;
return cfg;
}
+/* --- functions for merging configurations --- */
#define EPCFG_APP
#define EPCFG_REQ
@@ -329,12 +368,12 @@
mrg -> set_##STRUCT##NAME = 1 ; \
mrg -> STRUCT.NAME = add -> STRUCT.NAME ; \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Merge "#CFGNAME" (type="#TYPE") => %d\n", mrg -> STRUCT.NAME) ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Merge "#CFGNAME" (type="#TYPE") => %d\n", mrg -> STRUCT.NAME) ; \
} \
else \
{ \
if (bApDebug && mrg -> set_##STRUCT##NAME) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Merge "#CFGNAME" (type="#TYPE") stays %d\n", mrg -> STRUCT.NAME) ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Merge "#CFGNAME" (type="#TYPE") stays %d\n", mrg -> STRUCT.NAME) ; \
}
#define EPCFG_STR(STRUCT,TYPE,NAME,CFGNAME) \
@@ -343,12 +382,12 @@
mrg -> set_##STRUCT##NAME = 1 ; \
mrg -> STRUCT.NAME = add -> STRUCT.NAME ; \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Merge "#CFGNAME" (type="#TYPE") => %s\n", mrg -> STRUCT.NAME?mrg ->
STRUCT.NAME:"<null>") ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Merge "#CFGNAME" (type="#TYPE") => %s\n", mrg -> STRUCT.NAME?mrg ->
STRUCT.NAME:"<null>") ; \
} \
else \
{ \
if (bApDebug && mrg -> set_##STRUCT##NAME) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Merge "#CFGNAME" (type="#TYPE") stays %s\n", mrg -> STRUCT.NAME?mrg ->
STRUCT.NAME:"<null>") ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Merge "#CFGNAME" (type="#TYPE") stays %s\n", mrg -> STRUCT.NAME?mrg ->
STRUCT.NAME:"<null>") ; \
}
#undef EPCFG_SAVE
@@ -359,17 +398,17 @@
mrg -> STRUCT.NAME = add -> STRUCT.NAME ; \
mrg -> save_##STRUCT##NAME = add -> save_##STRUCT##NAME ; \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Merge "#CFGNAME" (type="#TYPE") => %s\n", mrg -> save_##STRUCT##NAME?mrg ->
save_##STRUCT##NAME:"<null>") ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Merge "#CFGNAME" (type="#TYPE") => %s\n", mrg -> save_##STRUCT##NAME?mrg ->
save_##STRUCT##NAME:"<null>") ; \
} \
else \
{ \
if (bApDebug && mrg -> set_##STRUCT##NAME) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Merge "#CFGNAME" (type="#TYPE") stays %s\n", mrg -> save_##STRUCT##NAME?mrg ->
save_##STRUCT##NAME:"<null>") ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL, "Embperl:
Merge "#CFGNAME" (type="#TYPE") stays %s\n", mrg -> save_##STRUCT##NAME?mrg ->
save_##STRUCT##NAME:"<null>") ; \
}
-static void *embperl_merge_dir_config (pool *p, void *basev, void *addv)
+static void *embperl_merge_dir_config (apr_pool_t *p, void *basev, void *addv)
{
if (!basev)
return addv ;
@@ -382,7 +421,7 @@
memcpy (mrg, base, sizeof (*mrg)) ;
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
merge_dir/server_config\n") ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: merge_dir/server_config\n") ;
#include "epcfg.h"
@@ -397,13 +436,13 @@
-static char * embperl_Apache_Config_useenv (cmd_parms *cmd, tApacheDirConfig *
pDirCfg, bool arg)
- { \
- pDirCfg -> bUseEnv = arg ;
+static const char * embperl_Apache_Config_useenv (cmd_parms *cmd,
/*tApacheDirConfig*/ void * pDirCfg, int arg)
+ {
+ ((tApacheDirConfig *)pDirCfg) -> bUseEnv = arg ;
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set
UseEnv = %d\n", arg) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL, "Embperl:
Set UseEnv = %d\n", arg) ;
- return NULL; \
+ return NULL;
}
@@ -418,20 +457,20 @@
{
if(r && r->per_dir_config)
{
- *ppConfig = (tApacheDirConfig *) get_module_config(r->per_dir_config,
&embperl_module);
+ *ppConfig = (tApacheDirConfig *)
ap_get_module_config(r->per_dir_config, &embperl_module);
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL,
"Embperl: GetApacheConfig for dir\n") ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: GetApacheConfig for dir\n") ;
}
else if(s && s->lookup_defaults) /*s->module_config)*/
{
- *ppConfig = (tApacheDirConfig *) get_module_config(s->lookup_defaults
/*s->module_config*/, &embperl_module);
+ *ppConfig = (tApacheDirConfig *)
ap_get_module_config(s->lookup_defaults /*s->module_config*/, &embperl_module);
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL,
"Embperl: GetApacheConfig for server\n") ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: GetApacheConfig for server\n") ;
}
}
else
if (bApDebug)
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
GetApacheConfig -> no config available for %s\n",r && r->per_dir_config?"dir":"server"
) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: GetApacheConfig -> no config available for %s\n",r &&
r->per_dir_config?"dir":"server" ) ;
return ok ;
}
@@ -457,11 +496,11 @@
#define EPCFG(STRUCT,TYPE,NAME,CFGNAME) \
if (bApDebug && pDirCfg -> set_##STRUCT##NAME) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Get "#CFGNAME" (type="#TYPE") stays %d\n", pDirCfg -> STRUCT.NAME) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Get "#CFGNAME" (type="#TYPE") stays %d\n", pDirCfg -> STRUCT.NAME) ;
#define EPCFG_STR(STRUCT,TYPE,NAME,CFGNAME) \
if (bApDebug && pDirCfg -> set_##STRUCT##NAME) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Get "#CFGNAME" (type="#TYPE") %s\n", pDirCfg -> STRUCT.NAME?pDirCfg ->
STRUCT.NAME:"<null>") ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Get "#CFGNAME" (type="#TYPE") %s\n", pDirCfg -> STRUCT.NAME?pDirCfg ->
STRUCT.NAME:"<null>") ;
@@ -470,7 +509,7 @@
if (pDirCfg -> save_##STRUCT##NAME && !pDirCfg -> STRUCT.NAME) \
{ \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Get, about to convert "#CFGNAME" (type="#TYPE";SV) to perl data\n") ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Get, about to convert "#CFGNAME" (type="#TYPE";SV) to perl data\n") ; \
\
pDirCfg -> STRUCT.NAME = newSVpv((char *)pDirCfg -> save_##STRUCT##NAME, 0)
; \
}
@@ -481,7 +520,7 @@
{ \
int rc ;\
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Get, about to convert "#CFGNAME" (type="#TYPE";CV) to perl data\n") ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Get, about to convert "#CFGNAME" (type="#TYPE";CV) to perl data\n") ; \
\
if ((rc = EvalConfig (pApp, sv_2mortal(newSVpv(pDirCfg ->
save_##STRUCT##NAME, 0)), 0, NULL, "Configuration: EMBPERL_"#CFGNAME, &pDirCfg ->
STRUCT.NAME)) != ok) \
LogError (pReq, rc) ; \
@@ -494,7 +533,7 @@
if (pDirCfg -> save_##STRUCT##NAME && !pDirCfg -> STRUCT.NAME) \
{ \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Get, about to convert "#CFGNAME" (type="#TYPE";AV) to perl data\n") ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Get, about to convert "#CFGNAME" (type="#TYPE";AV) to perl data\n") ; \
\
pDirCfg -> STRUCT.NAME = embperl_String2AV(pApp, pDirCfg ->
save_##STRUCT##NAME, SEPARATOR) ;\
tainted = 0 ; \
@@ -506,7 +545,7 @@
if (pDirCfg -> save_##STRUCT##NAME && !pDirCfg -> STRUCT.NAME) \
{ \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Get, about to convert "#CFGNAME" (type="#TYPE";HV) to perl data\n") ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Get, about to convert "#CFGNAME" (type="#TYPE";HV) to perl data\n") ; \
\
pDirCfg -> STRUCT.NAME = embperl_String2HV(pApp, pDirCfg ->
save_##STRUCT##NAME, ' ', NULL) ;\
tainted = 0 ; \
@@ -519,7 +558,7 @@
{ \
int rc ; \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl:
Get, about to convert "#CFGNAME" (type="#TYPE";REGEX) to perl data\n") ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL,
"Embperl: Get, about to convert "#CFGNAME" (type="#TYPE";REGEX) to perl data\n") ; \
\
if ((rc = EvalRegEx (pApp, pDirCfg -> save_##STRUCT##NAME, "Configuration:
EMBPERL_"#CFGNAME, &pDirCfg -> STRUCT.NAME)) != ok) \
return rc ; \
@@ -702,47 +741,47 @@
#undef EPCFG
#undef EPCFG_INT
#define EPCFG_INT(STRUCT,TYPE,NAME,CFGNAME) \
-char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd, tApacheDirConfig *
pDirCfg, char * arg) \
+const char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd, /*
tApacheDirConfig */ void * pDirCfg, const char * arg) \
{ \
- pDirCfg -> STRUCT.NAME = (TYPE)strtol(arg, NULL, 0) ; \
- pDirCfg -> set_##STRUCT##NAME = 1 ; \
+ ((tApacheDirConfig *)pDirCfg) -> STRUCT.NAME = (TYPE)strtol(arg, NULL, 0) ; \
+ ((tApacheDirConfig *)pDirCfg) -> set_##STRUCT##NAME = 1 ; \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set
"#CFGNAME" (type="#TYPE";INT) = %s\n", arg) ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL, "Embperl:
Set "#CFGNAME" (type="#TYPE";INT) = %s\n", arg) ; \
return NULL; \
}
#undef EPCFG_BOOL
#define EPCFG_BOOL(STRUCT,TYPE,NAME,CFGNAME) \
-char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd, tApacheDirConfig *
pDirCfg, char * arg) \
+const char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd, /*
tApacheDirConfig */ void * pDirCfg, const char * arg) \
{ \
- pDirCfg -> STRUCT.NAME = (TYPE)arg ; \
- pDirCfg -> set_##STRUCT##NAME = 1 ; \
+ ((tApacheDirConfig *)pDirCfg) -> STRUCT.NAME = (TYPE)arg ; \
+ ((tApacheDirConfig *)pDirCfg) -> set_##STRUCT##NAME = 1 ; \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set
"#CFGNAME" (type="#TYPE";BOOL) = %s\n", arg) ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL, "Embperl:
Set "#CFGNAME" (type="#TYPE";BOOL) = %s\n", arg) ; \
return NULL; \
}
#undef EPCFG_STR
#define EPCFG_STR(STRUCT,TYPE,NAME,CFGNAME) \
-char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd, tApacheDirConfig *
pDirCfg, char* arg) \
+const char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd, /*
tApacheDirConfig */ void * pDirCfg, const char* arg) \
{ \
- pool * p = cmd -> pool ; \
- pDirCfg -> STRUCT.NAME = ap_pstrdup(p, arg) ; \
- pDirCfg -> set_##STRUCT##NAME = 1 ; \
+ apr_pool_t * p = cmd -> pool ; \
+ ((tApacheDirConfig *)pDirCfg) -> STRUCT.NAME = ap_pstrdup(p, arg) ; \
+ ((tApacheDirConfig *)pDirCfg) -> set_##STRUCT##NAME = 1 ; \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set
"#CFGNAME" (type="#TYPE";STR) = %s\n", arg) ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL, "Embperl:
Set "#CFGNAME" (type="#TYPE";STR) = %s\n", arg) ; \
return NULL; \
}
#undef EPCFG_CHAR
#define EPCFG_CHAR(STRUCT,TYPE,NAME,CFGNAME) \
-char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd, tApacheDirConfig *
pDirCfg, char * arg) \
+const char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd, /*
tApacheDirConfig */ void * pDirCfg, const char * arg) \
{ \
- pDirCfg -> STRUCT.NAME = (TYPE)arg[0] ; \
- pDirCfg -> set_##STRUCT##NAME = 1 ; \
+ ((tApacheDirConfig *)pDirCfg) -> STRUCT.NAME = (TYPE)arg[0] ; \
+ ((tApacheDirConfig *)pDirCfg) -> set_##STRUCT##NAME = 1 ; \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set
"#CFGNAME" (type="#TYPE";CHAR) = %s\n", arg) ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL, "Embperl:
Set "#CFGNAME" (type="#TYPE";CHAR) = %s\n", arg) ; \
return NULL; \
}
@@ -759,12 +798,12 @@
#undef EPCFG_SAVE
#define EPCFG_SAVE(STRUCT,TYPE,NAME,CFGNAME) \
-char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd, tApacheDirConfig *
pDirCfg, char* arg) \
+const char * embperl_Apache_Config_##STRUCT##NAME (cmd_parms *cmd, /*
tApacheDirConfig */ void * pDirCfg, const char* arg) \
{ \
- pDirCfg -> save_##STRUCT##NAME = ap_pstrdup(cmd -> pool, arg) ; \
- pDirCfg -> set_##STRUCT##NAME = 1 ; \
+ ((tApacheDirConfig *)pDirCfg) -> save_##STRUCT##NAME = ap_pstrdup(cmd -> pool,
arg) ; \
+ ((tApacheDirConfig *)pDirCfg) -> set_##STRUCT##NAME = 1 ; \
if (bApDebug) \
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set
"#CFGNAME" (type="#TYPE") = %s (save for later conversion to Perl data)\n", arg) ; \
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, NULL, "Embperl:
Set "#CFGNAME" (type="#TYPE") = %s (save for later conversion to Perl data)\n", arg) ;
\
return NULL ; \
}
1.1.2.52 +8 -8 embperl/Attic/epinit.c
Index: epinit.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epinit.c,v
retrieving revision 1.1.2.51
retrieving revision 1.1.2.52
diff -u -r1.1.2.51 -r1.1.2.52
--- epinit.c 23 May 2002 07:54:48 -0000 1.1.2.51
+++ epinit.c 23 May 2002 22:24:45 -0000 1.1.2.52
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epinit.c,v 1.1.2.51 2002/05/23 07:54:48 richter Exp $
+# $Id: epinit.c,v 1.1.2.52 2002/05/23 22:24:45 richter Exp $
#
###################################################################################*/
@@ -709,7 +709,7 @@
{
/* when running under mod_perl only register the module */
/* rest will be call from module initialzation when config has been read */
- embperl_ApacheAddModule (ap_s -> pool) ;
+ embperl_ApacheAddModule () ;
return ok ;
}
#endif
@@ -1039,8 +1039,8 @@
#ifdef APACHE
if (r -> pApacheReq)
{
- const char * sLength = table_get(r -> pApacheReq->headers_in,
"Content-Length") ;
- sType = table_get(r -> pApacheReq->headers_in, "Content-Type") ;
+ const char * sLength = apr_table_get(r -> pApacheReq->headers_in,
"Content-Length") ;
+ sType = apr_table_get(r -> pApacheReq->headers_in, "Content-Type") ;
len = sLength?atoi (sLength):0 ;
}
else
@@ -1148,11 +1148,11 @@
if (r -> pApacheReq && (r -> Config.bDebug & dbgHeadersIn))
{
int i;
- array_header *hdrs_arr;
- table_entry *hdrs;
+ const apr_array_header_t *hdrs_arr;
+ apr_table_entry_t *hdrs;
- hdrs_arr = table_elts (r -> pApacheReq->headers_in);
- hdrs = (table_entry *)hdrs_arr->elts;
+ hdrs_arr = apr_table_elts (r -> pApacheReq->headers_in);
+ hdrs = (apr_table_entry_t *)hdrs_arr->elts;
lprintf (r -> pApp, "[%d]HDR: %d\n", r -> pThread -> nPid,
hdrs_arr->nelts) ;
for (i = 0; i < hdrs_arr->nelts; ++i)
1.16.4.15 +8 -8 embperl/epio.c
Index: epio.c
===================================================================
RCS file: /home/cvs/embperl/epio.c,v
retrieving revision 1.16.4.14
retrieving revision 1.16.4.15
diff -u -r1.16.4.14 -r1.16.4.15
--- epio.c 23 May 2002 07:54:48 -0000 1.16.4.14
+++ epio.c 23 May 2002 22:24:45 -0000 1.16.4.15
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epio.c,v 1.16.4.14 2002/05/23 07:54:48 richter Exp $
+# $Id: epio.c,v 1.16.4.15 2002/05/23 22:24:45 richter Exp $
#
###################################################################################*/
@@ -492,14 +492,14 @@
#if defined (APACHE)
if (r -> pApacheReq)
{
- setup_client_block(r -> pApacheReq, REQUEST_CHUNKED_ERROR);
- if(should_client_block(r -> pApacheReq))
+ ap_setup_client_block(r -> pApacheReq, REQUEST_CHUNKED_ERROR);
+ if(ap_should_client_block(r -> pApacheReq))
{
int c ;
int n = 0 ;
while (1)
{
- c = get_client_block(r -> pApacheReq, p, size);
+ c = ap_get_client_block(r -> pApacheReq, p, size);
if (c < 0 || c == 0)
return n ;
n += c ;
@@ -896,9 +896,9 @@
{
if (n > 0)
{
- n = rwrite (ptr, n, r -> pApacheReq) ;
+ n = ap_rwrite (ptr, n, r -> pApacheReq) ;
if (r -> Component.Config.bDebug & dbgFlushOutput)
- rflush (r -> pApacheReq) ;
+ ap_rflush (r -> pApacheReq) ;
return n ;
}
else
@@ -940,9 +940,9 @@
#if defined (APACHE)
if (r -> pApacheReq && r -> Component.pOutput -> ofd == NULL)
{
- rputc (c, r -> pApacheReq) ;
+ ap_rputc (c, r -> pApacheReq) ;
if (r -> Component.Config.bDebug & dbgFlushOutput)
- rflush (r -> pApacheReq) ;
+ ap_rflush (r -> pApacheReq) ;
return ;
}
#endif
1.75.4.118 +11 -7 embperl/epmain.c
Index: epmain.c
===================================================================
RCS file: /home/cvs/embperl/epmain.c,v
retrieving revision 1.75.4.117
retrieving revision 1.75.4.118
diff -u -r1.75.4.117 -r1.75.4.118
--- epmain.c 23 May 2002 07:54:48 -0000 1.75.4.117
+++ epmain.c 23 May 2002 22:24:46 -0000 1.75.4.118
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epmain.c,v 1.75.4.117 2002/05/23 07:54:48 richter Exp $
+# $Id: epmain.c,v 1.75.4.118 2002/05/23 22:24:46 richter Exp $
#
###################################################################################*/
@@ -243,9 +243,9 @@
if (r && r -> pApacheReq)
#ifdef APLOG_ERR
if (rc != rcPerlWarn)
- aplog_error (APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r -> pApacheReq ->
server, "%s", sText) ;
+ ap_log_error (APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r -> pApacheReq
-> server, "%s", sText) ;
else
- aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, r -> pApacheReq
-> server, "%s", sText) ;
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, r ->
pApacheReq -> server, "%s", sText) ;
#else
log_error (sText, r -> pApacheReq -> server) ;
#endif
@@ -666,8 +666,10 @@
}
else
{
+#ifndef APACHE2
if (r -> pApacheReq -> main == NULL && (r -> Config.bOptions &
optSendHttpHeader))
send_http_header (r -> pApacheReq) ;
+#endif
#ifndef WIN32
/* shouldn't be neccessary for newer mod_perl versions !? */
/* mod_perl_sent_header(r -> pApacheReq, 1) ; */
@@ -863,7 +865,7 @@
{
svp = av_fetch(arr, i, 0);
p = SvPV(*svp, ldummy);
- table_add( r->pApacheReq->headers_out,
apr_pstrdup(r->pApacheReq->pool, pKey),
+ apr_table_add( r->pApacheReq->headers_out,
apr_pstrdup(r->pApacheReq->pool, pKey),
apr_pstrdup(r->pApacheReq->pool, p ) );
if (loc == 1)
{
@@ -875,7 +877,7 @@
else
{
p = SvPV(pHeader, ldummy);
- table_set(r -> pApacheReq->headers_out, apr_pstrdup(r ->
pApacheReq->pool, pKey), apr_pstrdup(r -> pApacheReq->pool, p)) ;
+ apr_table_set(r -> pApacheReq->headers_out, apr_pstrdup(r ->
pApacheReq->pool, pKey), apr_pstrdup(r -> pApacheReq->pool, p)) ;
if (loc == 1) loc = 2;
}
@@ -885,17 +887,19 @@
if (pCookie)
- table_add(r -> pApacheReq->headers_out, "Set-Cookie", pCookie) ;
+ apr_table_add(r -> pApacheReq->headers_out, "Set-Cookie", pCookie) ;
#if 0
if (r -> Component.Config.bEP1Compat) /* Embperl 2 currently cannot calc
Content Length */
set_content_length (r -> pApacheReq, GetContentLength (r) + (r ->
Component.pCurrEscape?2:0)) ;
#endif
+#ifndef APACHE2
send_http_header (r -> pApacheReq) ;
+#endif
if (r -> Component.Config.bDebug & dbgHeadersIn)
{
int i;
- apr_array_header_t *hdrs_arr;
+ const apr_array_header_t *hdrs_arr;
apr_table_entry_t *hdrs;
hdrs_arr = apr_table_elts (r -> pApacheReq->headers_out);
1.19.4.22 +19 -8 embperl/epnames.h
Index: epnames.h
===================================================================
RCS file: /home/cvs/embperl/epnames.h,v
retrieving revision 1.19.4.21
retrieving revision 1.19.4.22
diff -u -r1.19.4.21 -r1.19.4.22
--- epnames.h 23 May 2002 07:54:48 -0000 1.19.4.21
+++ epnames.h 23 May 2002 22:24:46 -0000 1.19.4.22
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epnames.h,v 1.19.4.21 2002/05/23 07:54:48 richter Exp $
+# $Id: epnames.h,v 1.19.4.22 2002/05/23 22:24:46 richter Exp $
#
###################################################################################*/
@@ -425,13 +425,6 @@
#endif /* APACHE */
-#ifndef APACHE
-
-typedef void request_rec ;
-typedef void server_rec ;
-
-#endif
-
#ifndef INT2PTR
@@ -461,12 +454,30 @@
#endif
+/* make some defines to use same type in Apache 1 & Apache 2 */
+
#ifndef APACHE2
+
#define apr_pstrdup ap_pstrdup
#define apr_palloc ap_palloc
#define apr_pool_t pool
#define apr_array_header_t array_header
#define apr_table_entry_t table_entry
#define apr_table_elts table_elts
+#define apr_table_get ap_table_get
+#define apr_table_set ap_table_set
+#define apr_table_add ap_table_add
+
+#endif
+
+
+/* define some types, that are necessary in non Apache mode and will be passed as
dummy parameters */
+
+#ifndef APACHE
+
+typedef void request_rec ;
+typedef void server_rec ;
+typedef void apr_pool_t ;
+
#endif
1.1.2.18 +2 -2 embperl/Attic/eppriv.h
Index: eppriv.h
===================================================================
RCS file: /home/cvs/embperl/Attic/eppriv.h,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -u -r1.1.2.17 -r1.1.2.18
--- eppriv.h 23 May 2002 07:54:48 -0000 1.1.2.17
+++ eppriv.h 23 May 2002 22:24:46 -0000 1.1.2.18
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: eppriv.h,v 1.1.2.17 2002/05/23 07:54:48 richter Exp $
+# $Id: eppriv.h,v 1.1.2.18 2002/05/23 22:24:46 richter Exp $
#
###################################################################################*/
@@ -158,7 +158,7 @@
/* --- configuration --- */
-void embperl_ApacheAddModule (apr_pool_t * pool) ;
+void embperl_ApacheAddModule (void) ;
int embperl_GetApacheConfig (/*in*/ tThreadData * pThread,
/*in*/ request_rec * r,
/*in*/ server_rec * s,
No revision
No revision
1.24.4.59 +13 -3 embperl/test/conf/httpd.conf.src
Index: httpd.conf.src
===================================================================
RCS file: /home/cvs/embperl/test/conf/httpd.conf.src,v
retrieving revision 1.24.4.58
retrieving revision 1.24.4.59
diff -u -r1.24.4.58 -r1.24.4.59
--- httpd.conf.src 20 Mar 2002 20:38:59 -0000 1.24.4.58
+++ httpd.conf.src 23 May 2002 22:24:47 -0000 1.24.4.59
@@ -6,7 +6,7 @@
ServerRoot \"$EPPATH/test\"
ServerName localhost
DocumentRoot \"$EPPATH/test\"
-Port $EPPORT
+Listen $EPPORT
EOD
if ($^O ne 'MSWin32')
@@ -26,7 +26,7 @@
EOD
}
-print OFH "Listen ", $EPPORT , "\n" ;
+#print OFH "Listen ", $EPPORT , "\n" ;
print OFH "Listen ", $EPPORT + 3, "\n" ;
print OFH "Listen ", $EPPORT + 4, "\n" ;
print OFH "Listen ", $EPPORT + 5, "\n" ;
@@ -35,6 +35,7 @@
print OFH <<EOD ;
$EPMODPERL
+LoadModule embperl_module \"$EPPATH/blib/arch/auto/Embperl/Embperl.so"
DirectoryIndex index.htm
@@ -64,8 +65,18 @@
ErrorLog tmp/httpd.err.log
PidFile tmp/httpd.pid
+EOD
+
+
+if (!$MP2)
+ {
+print OFH <<EOD ;
AccessConfig conf/null
ResourceConfig conf/null
+EOD
+ }
+
+print OFH <<EOD ;
TypesConfig conf/null
LockFile tmp/httpd.lock
@@ -78,7 +89,6 @@
EOD
-
if ($EPSESSIONXVERSION)
1.9.6.13 +4 -3 embperl/test/conf/startup.pl
Index: startup.pl
===================================================================
RCS file: /home/cvs/embperl/test/conf/startup.pl,v
retrieving revision 1.9.6.12
retrieving revision 1.9.6.13
diff -u -r1.9.6.12 -r1.9.6.13
--- startup.pl 5 Mar 2002 08:07:23 -0000 1.9.6.12
+++ startup.pl 23 May 2002 22:24:47 -0000 1.9.6.13
@@ -4,7 +4,7 @@
use ExtUtils::testlib ;
use Cwd ;
- my $cwd = $ENV{EMBPERL_SRC} ;
+ my $cwd = $ENV{EMBPERL_SRC} || '/usr/msrc/ep2a' ;
my $i = 0 ;
foreach (@INC)
{
@@ -12,11 +12,12 @@
$i++ ;
}
+ eval "use Apache ;" ;
+ eval "use Apache::Registry ;" ;
} ;
-use Apache ;
-use Apache::Registry ;
+use Apache::ServerUtil ;
use Embperl ;
use Embperl::Object ;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]