richter 02/05/24 00:25:36
Modified: . Tag: Embperl2c Embperl.pm epapinit.c epnames.h
test/conf Tag: Embperl2c startup.pl
Log:
Apache 2
Revision Changes Path
No revision
No revision
1.118.4.109 +27 -5 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.118.4.108
retrieving revision 1.118.4.109
diff -u -r1.118.4.108 -r1.118.4.109
--- Embperl.pm 24 May 2002 05:43:14 -0000 1.118.4.108
+++ Embperl.pm 24 May 2002 07:25:35 -0000 1.118.4.109
@@ -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.108 2002/05/24 05:43:14 richter Exp $
+# $Id: Embperl.pm,v 1.118.4.109 2002/05/24 07:25:35 richter Exp $
#
###################################################################################
@@ -41,6 +41,7 @@
$importno
%initparam
$modperl
+ $modperl2
) ;
@@ -48,7 +49,13 @@
$VERSION = '2.0b8_dev-8' ;
-$modperl = $ENV{MOD_PERL} ;
+
+if ($modperl = $ENV{MOD_PERL})
+ {
+ $modperl =~ m#/(\d+)\.(\d+)# ;
+ $modperl2 = 1 if ($1 == 2 || ($1 == 1 && $2 >= 99)) ;
+ }
+
if ($ENV{PERL_DL_NONLAZY}
&& substr($ENV{GATEWAY_INTERFACE} || '', 0, 8) ne 'CGI-Perl'
@@ -58,12 +65,19 @@
DynaLoader::boot_DynaLoader ('DynaLoader');
}
+if ($modperl2)
+ {
+ require Apache::ServerUtil ;
+ }
if (!defined(&Embperl::Init))
{
- bootstrap Embperl $VERSION;
+ bootstrap Embperl $VERSION ;
+ print STDERR "Boot\n" ;
Boot ($VERSION) ;
- Init ($modperl?(defined(&Apache::ServerUtil::server)?Apache::ServerUtil ->
server:Apache -> server):undef, \%initparam) ;
+ print STDERR "Init\n" ;
+ Init ($modperl?Apache -> server:undef, \%initparam) ;
+ print STDERR "Init done\n" ;
}
$cwd = Cwd::fastcwd();
@@ -129,8 +143,16 @@
if ($Embperl::modperl)
{
- eval 'use Apache::Constants qw(&OPT_EXECCGI &DECLINED &OK &FORBIDDEN)' ;
- die "use Apache::Constants failed: $@" if ($@);
+ if (!$Embperl::modperl2)
+ {
+ eval 'use Apache::Constants qw(&OPT_EXECCGI &DECLINED &OK &FORBIDDEN)' ;
+ die "use Apache::Constants failed: $@" if ($@);
+ }
+ else
+ {
+ eval 'use Apache::Const qw(&OPT_EXECCGI &DECLINED &OK &FORBIDDEN)' ;
+ die "use Apache::Const failed: $@" if ($@);
+ }
}
#######################################################################################
1.1.2.40 +14 -6 embperl/epapinit.c
Index: epapinit.c
===================================================================
RCS file: /home/cvs/embperl/epapinit.c,v
retrieving revision 1.1.2.39
retrieving revision 1.1.2.40
diff -u -r1.1.2.39 -r1.1.2.40
--- epapinit.c 24 May 2002 05:43:14 -0000 1.1.2.39
+++ epapinit.c 24 May 2002 07:25:35 -0000 1.1.2.40
@@ -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.39 2002/05/24 05:43:14 richter Exp $
+# $Id: epapinit.c,v 1.1.2.40 2002/05/24 07:25:35 richter Exp $
#
###################################################################################*/
@@ -36,7 +36,7 @@
#endif
#endif
-static int bApDebug = 0 ;
+static int bApDebug = 1; // 0 ;
/* define config prototypes */
@@ -129,7 +129,7 @@
static void embperl_register_hooks (apr_pool_t * p)
{
- ap_hook_post_config(embperl_ApacheInit, NULL, NULL, APR_HOOK_MIDDLE) ;
+ ap_hook_open_logs(embperl_ApacheInit, NULL, NULL, APR_HOOK_LAST) ; /* make sure
we run after modperl init */
}
@@ -181,9 +181,13 @@
{
apr_pool_t * pool ;
+ bApDebug |= ap_exists_config_define("EMBPERL_APDEBUG") ;
#ifdef APACHE2
- ap_log_error (APLOG_MARK, APLOG_ERR, APLOG_STATUSCODE NULL, "Embperl:
embperl_ApacheAddModule not support within Apache 2.0 [%d/%d]\n", getpid(), gettid()) ;
+ if (bApDebug)
+ ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, APLOG_STATUSCODE
NULL, "Embperl: Perl part initialization start [%d/%d]\n", getpid(), gettid()) ;
+ if (!ap_find_linked_module("epapinit.c"))
+ ap_log_error (APLOG_MARK, APLOG_ERR, APLOG_STATUSCODE NULL, "Embperl.so
must be loaded with LoadModule before you load the Perl module [%d/%d]\n", getpid(),
gettid()) ;
return ;
/*
void * p = dlsym (0, "apr_global_hook_pool") ;
@@ -196,9 +200,8 @@
pool = *((apr_pool_t * *)(p)) ;
*/
-#endif
+#else
- bApDebug = ap_exists_config_define("EMBPERL_APDEBUG") ;
if (!ap_find_linked_module("embperl.c"))
{
@@ -215,6 +218,7 @@
else
if (bApDebug)
ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO,
APLOG_STATUSCODE NULL, "Embperl: embperl.c already added as dynamic module [%d/%d]\n",
getpid(), gettid()) ;
+#endif
}
@@ -233,14 +237,16 @@
#else
apr_pool_t * subpool = ap_make_sub_pool(p);
#endif
+
+ bApDebug |= ap_exists_config_define("EMBPERL_APDEBUG") ;
if (bApDebug)
ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, APLOG_STATUSCODE
NULL, "Embperl: ApacheInit [%d/%d]\n", getpid(), gettid()) ;
- ap_register_cleanup(subpool, NULL, embperl_ApacheInitCleanup,
embperl_ApacheInitCleanup);
#ifdef APACHE2
ap_add_version_component (p, "Embperl/"VERSION) ;
#else
+ ap_register_cleanup(subpool, NULL, embperl_ApacheInitCleanup,
embperl_ApacheInitCleanup);
ap_add_version_component ("Embperl/"VERSION) ;
#endif
@@ -310,6 +316,8 @@
static void *embperl_create_server_config(apr_pool_t * p, server_rec *s)
{
tApacheDirConfig *cfg = (tApacheDirConfig *) ap_pcalloc(p,
sizeof(tApacheDirConfig));
+
+ bApDebug |= ap_exists_config_define("EMBPERL_APDEBUG") ;
embperl_DefaultReqConfig (&cfg -> ReqConfig) ;
embperl_DefaultAppConfig (&cfg -> AppConfig) ;
1.19.4.24 +4 -3 embperl/epnames.h
Index: epnames.h
===================================================================
RCS file: /home/cvs/embperl/epnames.h,v
retrieving revision 1.19.4.23
retrieving revision 1.19.4.24
diff -u -r1.19.4.23 -r1.19.4.24
--- epnames.h 24 May 2002 05:43:15 -0000 1.19.4.23
+++ epnames.h 24 May 2002 07:25:35 -0000 1.19.4.24
@@ -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.23 2002/05/24 05:43:15 richter Exp $
+# $Id: epnames.h,v 1.19.4.24 2002/05/24 07:25:35 richter Exp $
#
###################################################################################*/
@@ -483,9 +483,10 @@
#ifdef APACHE
+#ifdef APACHE2
+#define APLOG_STATUSCODE 0,
+#else
#define APLOG_STATUSCODE
#endif
+#endif
-#ifdef APACHE2
-#define APLOG_STATUSCODE 0,
-#endif
\ No newline at end of file
No revision
No revision
1.9.6.15 +12 -4 embperl/test/conf/startup.pl
Index: startup.pl
===================================================================
RCS file: /home/cvs/embperl/test/conf/startup.pl,v
retrieving revision 1.9.6.14
retrieving revision 1.9.6.15
diff -u -r1.9.6.14 -r1.9.6.15
--- startup.pl 24 May 2002 05:43:15 -0000 1.9.6.14
+++ startup.pl 24 May 2002 07:25:35 -0000 1.9.6.15
@@ -4,7 +4,8 @@
use ExtUtils::testlib ;
use Cwd ;
- my $cwd = $ENV{EMBPERL_SRC} || '/usr/msrc/ep2a' ;
+ $ENV{EMBPERL_SRC} ||= '/usr/msrc/ep2a' ;
+ my $cwd = $ENV{EMBPERL_SRC} ;
my $i = 0 ;
foreach (@INC)
{
@@ -12,12 +13,19 @@
$i++ ;
}
- eval "use Apache ;" ;
- eval "use Apache::Registry ;" ;
+ $ENV{MOD_PERL} =~ m#/(\d+)\.(\d+)# ;
+ $mp2 = 1 if ($1 == 2 || ($1 == 1 && $2 >= 99)) ;
+ print STDERR "Runing under modperl ", $mp2?2:1, " ($ENV{MOD_PERL})\n" ;
+
+ if (!$mp2)
+ {
+ require Apache ;
+ require Apache::Registry ;
+ }
} ;
-#use Apache::ServerUtil ;
+
use Embperl ;
use Embperl::Object ;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]