richter 2005/02/25 00:06:22
Modified: . Changes.pod TODO embperl.h epcomp.c epmain.c
Embperl App.pm
test/cmp Execute.htm
test/html/registry Execute.htm
Log:
- Output an error message when an Embperl sub is called and no
Embperl request is active.
- Do not use method call to output in send_error_page to avoid
trouble with overloaded output function.
Revision Changes Path
1.261 +4 -0 embperl/Changes.pod
Index: Changes.pod
===================================================================
RCS file: /home/cvs/embperl/Changes.pod,v
retrieving revision 1.260
retrieving revision 1.261
diff -u -r1.260 -r1.261
--- Changes.pod 22 Feb 2005 16:34:28 -0000 1.260
+++ Changes.pod 25 Feb 2005 08:06:21 -0000 1.261
@@ -17,6 +17,10 @@
- Fixed make test module load problem for mod_perl tests, when
mod_perl is staticly linked into Apache
- Documentation updates and cleanup
+ - Output an error message when an Embperl sub is called and no
+ Embperl request is active.
+ - Do not use method call to output in send_error_page to avoid
+ trouble with overloaded output function.
=head1 2.0rc2 21. November 2004
1.131 +3 -7 embperl/TODO
Index: TODO
===================================================================
RCS file: /home/cvs/embperl/TODO,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -r1.130 -r1.131
--- TODO 14 Feb 2005 18:49:04 -0000 1.130
+++ TODO 25 Feb 2005 08:06:21 -0000 1.131
@@ -13,15 +13,11 @@
- make test fedora 1 [13.12.04]
-- quote msgid syntax [12.12.04]
+- return object reference in @errors [Robert Norris 23.2.05]
+- EmbperlObject and ErrorDocument [Robert Noris 24.2.05]
-SOLVED, need more TESTS:
-
-- Perl hash error at end of apache and apachectl restart
-
-- preload on Apache startup problem [Neil Gunton 25.1.04]
-
+- $req_rec setting when call under Registry [Martin Moss 22.3.05]
TODO for Embperl 2.1 and later
1.35 +3 -1 embperl/embperl.h
Index: embperl.h
===================================================================
RCS file: /home/cvs/embperl/embperl.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- embperl.h 23 Jan 2004 06:50:54 -0000 1.34
+++ embperl.h 25 Feb 2005 08:06:21 -0000 1.35
@@ -1,3 +1,4 @@
+
/*###################################################################################
#
# Embperl - Copyright (c) 1997-2004 Gerald Richter / ECOS
@@ -94,6 +95,7 @@
rcTooDeepNested,
rcUnknownOption,
rcTimeFormatErr,
+ rcSubCallNotRequest,
rcForbidden = 403,
rcNotFound = 404,
rcDecline = -1
1.18 +7 -1 embperl/epcomp.c
Index: epcomp.c
===================================================================
RCS file: /home/cvs/embperl/epcomp.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- epcomp.c 16 Aug 2004 07:36:15 -0000 1.17
+++ epcomp.c 25 Feb 2005 08:06:21 -0000 1.18
@@ -1999,6 +1999,12 @@
tDomTree * pDomTree ;
tDomTree * pCurrDomTree ;
+ if (!r || !r -> Component.bReqRunning)
+ {
+ LogErrorParam (r -> pApp, rcSubCallNotRequest, "", "") ;
+ return 0 ;
+ }
+
#if 0
if (SvIOK (pDomTreeSV))
if (xOrgDomTree = SvIVX (pDomTreeSV))
1.137 +2 -1 embperl/epmain.c
Index: epmain.c
===================================================================
RCS file: /home/cvs/embperl/epmain.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -r1.136 -r1.137
--- epmain.c 16 Jan 2005 13:31:13 -0000 1.136
+++ epmain.c 25 Feb 2005 08:06:21 -0000 1.137
@@ -177,6 +177,7 @@
case rcTooDeepNested: msg ="[%d]ERR: %d: %s Source data
is too deep nested %s %s" ; break ;
case rcUnknownOption: msg ="[%d]ERR: %d: %s Unkown option
'%s' in configuration directive '%s'" ; break ;
case rcTimeFormatErr: msg ="[%d]ERR: %d: %s Format error
in %s = %s" ; break ;
+ case rcSubCallNotRequest: msg ="[%d]ERR: %d: %s A Embperl sub
is called and no Embperl request is running %s %s" ; break ;
default: msg ="[%d]ERR: %d: %s Error (no
description) %s %s" ; break ;
}
1.5 +18 -20 embperl/Embperl/App.pm
Index: App.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/App.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- App.pm 17 Aug 2004 03:53:45 -0000 1.4
+++ App.pm 25 Feb 2005 08:06:22 -0000 1.5
@@ -77,7 +77,6 @@
my ($self, $r) = @_ ;
local $SIG{__WARN__} = 'Default' ;
-
my $virtlog = '' ; # $r -> VirtLogURI || '' ;
my $logfilepos = $r -> log_file_start_pos ;
my $url = '' ; # $Embperl::dbgLogLink?"<A
HREF=\"$virtlog\?$logfilepos\&$$\">Logfile</A>":'' ;
@@ -88,53 +87,52 @@
my $time = localtime ;
my $mail = $req_rec -> server -> server_admin if (defined ($req_rec)) ;
$mail ||= '' ;
-
$req_rec -> content_type('text/html') if (defined ($req_rec)) ;
- $r -> output ("<HTML><HEAD><TITLE>Embperl Error</TITLE></HEAD><BODY
bgcolor=\"#FFFFFF\">\r\n$url") ;
- $r -> output ("<H1>Internal Server Error</H1>\r\n") ;
- $r -> output ("The server encountered an internal error or
misconfiguration and was unable to complete your request.<P>\r\n") ;
- $r -> output ("Please contact the server administrator, $mail and inform
them of the time the error occurred, and anything you might have done that may
have caused the error.<P><P>\r\n") ;
+ # don't use method call to avoid trouble with overloading
+ Embperl::Req::output ($r,"<HTML><HEAD><TITLE>Embperl
Error</TITLE></HEAD><BODY bgcolor=\"#FFFFFF\">\r\n$url") ;
+ Embperl::Req::output ($r,"<H1>Internal Server Error</H1>\r\n") ;
+ Embperl::Req::output ($r,"The server encountered an internal error or
misconfiguration and was unable to complete your request.<P>\r\n") ;
+ Embperl::Req::output ($r,"Please contact the server administrator, $mail
and inform them of the time the error occurred, and anything you might have
done that may have caused the error.<P><P>\r\n") ;
my $errors = $r -> errors ;
if ($virtlog ne '' && $Embperl::dbgLogLink)
{
foreach $err (@$errors)
{
- $r -> output ("<A HREF=\"$virtlog?$logfilepos&$$#E$cnt\">") ;
#<tt>") ;
+ Embperl::Req::output ($r,"<A
HREF=\"$virtlog?$logfilepos&$$#E$cnt\">") ; #<tt>") ;
$Embperl::escmode = 3 ;
$err =~ s|\\|\\\\|g;
$err =~ s|\n|\n\\<br\\>\\ \\ \\ \\ |g;
$err =~ s|(Line [0-9]*:)|$1\\</a\\>|;
- $r -> output ($err) ;
+ Embperl::Req::output ($r,$err) ;
$Embperl::escmode = 0 ;
- $r -> output ("<p>\r\n") ;
- #$r -> output ("</tt><p>\r\n") ;
+ Embperl::Req::output ($r,"<p>\r\n") ;
+ #Embperl::Req::output ($r,"</tt><p>\r\n") ;
$cnt++ ;
}
}
else
{
$Embperl::escmode = 3 ;
- $r -> output ("\\<table cellspacing='2' cellpadding='5'\\>\r\n") ;
+ Embperl::Req::output ($r,"\\<table cellspacing='2'
cellpadding='5'\\>\r\n") ;
foreach $err (@$errors)
{
$err =~ s|\\|\\\\|g;
$err =~ s|\n|\n\\<br\\>\\ \\ \\ \\ |g;
- $r -> output ("\\<tr bgcolor='#eeeeee'\\>\\<td\\>\r\n\\<!-- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - --\\>\r\n") ;
- $r -> output ("$err\r\n") ;
- $r -> output ("\\<!-- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - --\\>\r\n\\</td\\>\\</tr\\>\r\n") ;
- #$r -> output ("\\<tt\\>$err\\</tt\\>\\<p\\>\r\n") ;
+ Embperl::Req::output ($r,"\\<tr
bgcolor='#eeeeee'\\>\\<td\\>\r\n\\<!-- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - --\\>\r\n") ;
+ Embperl::Req::output ($r,"$err\r\n") ;
+ Embperl::Req::output ($r,"\\<!-- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - --\\>\r\n\\</td\\>\\</tr\\>\r\n") ;
+ #Embperl::Req::output ($r,"\\<tt\\>$err\\</tt\\>\\<p\\>\r\n") ;
$cnt++ ;
}
- $r -> output ("\\</table\\>\r\n\\<br\\>\n\r") ;
+ Embperl::Req::output ($r,"\\</table\\>\r\n\\<br\\>\n\r") ;
$Embperl::escmode = 0 ;
}
-
my $server = $ENV{SERVER_SOFTWARE} || 'Offline' ;
- $r -> output ($server . ($server =~ /Embperl/?'':" Embperl
$Embperl::VERSION") . " [$time]<P>\r\n") ;
- $r -> output ("</BODY></HTML>\r\n\r\n") ;
+ Embperl::Req::output ($r,$server . ($server =~ /Embperl/?'':" Embperl
$Embperl::VERSION") . " [$time]<P>\r\n") ;
+ Embperl::Req::output ($r,"</BODY></HTML>\r\n\r\n") ;
}
#
---------------------------------------------------------------------------------
1.7 +5 -5 embperl/test/cmp/Execute.htm
Index: Execute.htm
===================================================================
RCS file: /home/cvs/embperl/test/cmp/Execute.htm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Execute.htm 22 Feb 2005 16:34:29 -0000 1.6
+++ Execute.htm 25 Feb 2005 08:06:22 -0000 1.7
@@ -110,7 +110,7 @@
</H3>
-<H1> 10.) Test inside Execute</H1>
+<H1> 10.) Test $req_rec inside Execute</H1>
<html>
<head>
@@ -121,15 +121,15 @@
^\$_\[0\] = Embperl::Req=HASH\(0x
$_[1] = <undef> <br>
-^\$rec_rec = Apache::RequestRec=SCALAR\(0x
+^\$rec_rec = Apache(::RequestRec)?=SCALAR\(0x
^\$\$rec_rec = \d+<br>
-^Apache->request = Apache::RequestRec=SCALAR\(0x
+^Apache->request = Apache(::RequestRec)?=SCALAR\(0x
^\$\{Apache->request\} = \d+<br>
-${Apache->request} = $$req_rec ? no <br>
+^\${Apache->request} = \$\$req_rec \? yes
-^test/html/incif.htm
+^test/html/registry/Execute.htm
</body>
</html>
1.8 +1 -1 embperl/test/html/registry/Execute.htm
Index: Execute.htm
===================================================================
RCS file: /home/cvs/embperl/test/html/registry/Execute.htm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Execute.htm 22 Feb 2005 16:34:29 -0000 1.7
+++ Execute.htm 25 Feb 2005 08:06:22 -0000 1.8
@@ -128,7 +128,7 @@
print "\n<H3>$out</H3>\n" ;
-print "\n<H1> 10.) Test $req_rec inside Execute</H1>\n" ;
+print "\n<H1> 10.) Test \$req_rec inside Execute</H1>\n" ;
Embperl::Execute ('../reqrec.htm') ;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]