You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@locus.apache.org on 2000/03/29 09:00:43 UTC
cvs commit: embperl/test/html include.htm
richter 00/03/28 23:00:43
Modified: . Changes.pod Embperl.pm EmbperlObject.pm MANIFEST
Makefile.PL epmain.c
Embperl Mail.pm Module.pm
emacs embperl.el
test/cmp include.htm
test/html include.htm
Log:
- Applied a patch from Jens-Uwe Magner to make Embperl work
with mod_perl 1.22 on AIX. We now require mod_perl 1.22,
but I should now work as DSO and staticly linked.
- Applied a patch from Francis J. Lacoste that makes sure
that when a package name is given the file is always compiled
into this package. Note: This means that if you specify a
packagename and the packagename differs from request to
request, the page is compiled for every package and therfore
consuming memory on every request.
Revision Changes Path
1.107 +9 -0 embperl/Changes.pod
Index: Changes.pod
===================================================================
RCS file: /home/cvs/embperl/Changes.pod,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -r1.106 -r1.107
--- Changes.pod 2000/03/29 04:47:06 1.106
+++ Changes.pod 2000/03/29 07:00:38 1.107
@@ -18,6 +18,15 @@
mod_perl. Spotted by Ilia Lobsanov.
- Makefile.PL warns if you build with a DSO mod_perl < 1.22
- make test checks that test files are readable by Apache.
+ - Applied a patch from Jens-Uwe Magner to make Embperl work
+ with mod_perl 1.22 on AIX. We now require mod_perl 1.22,
+ but I should now work as DSO and staticly linked.
+ - Applied a patch from Francis J. Lacoste that makes sure
+ that when a package name is given the file is always compiled
+ into this package. Note: This means that if you specify a
+ packagename and the packagename differs from request to
+ request, the page is compiled for every package and therfore
+ consuming memory on every request.
=head1 1.3b2 (BETA) 11. Feb 2000
1.93 +0 -0 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- Embperl.pm 2000/03/29 04:47:06 1.92
+++ Embperl.pm 2000/03/29 07:00:38 1.93
@@ -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.92 2000/03/29 04:47:06 richter Exp $
+# $Id: Embperl.pm,v 1.93 2000/03/29 07:00:38 richter Exp $
#
###################################################################################
1.17 +0 -0 embperl/EmbperlObject.pm
Index: EmbperlObject.pm
===================================================================
RCS file: /home/cvs/embperl/EmbperlObject.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- EmbperlObject.pm 2000/03/29 04:47:06 1.16
+++ EmbperlObject.pm 2000/03/29 07:00:39 1.17
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: EmbperlObject.pm,v 1.16 2000/03/29 04:47:06 richter Exp $
+# $Id: EmbperlObject.pm,v 1.17 2000/03/29 07:00:39 richter Exp $
#
###################################################################################
1.36 +0 -1 embperl/MANIFEST
Index: MANIFEST
===================================================================
RCS file: /home/cvs/embperl/MANIFEST,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- MANIFEST 2000/01/06 11:02:17 1.35
+++ MANIFEST 2000/03/29 07:00:39 1.36
@@ -16,7 +16,6 @@
IntroD.pod
FeaturesD.pod
typemap
-mod_perl.exp
eg/README
eg/images/jazzbkgd.gif
eg/x/neu.htm
1.24 +9 -1 embperl/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/embperl/Makefile.PL,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Makefile.PL 2000/03/29 04:47:06 1.23
+++ Makefile.PL 2000/03/29 07:00:39 1.24
@@ -621,10 +621,13 @@
#$EPMODPERL="LoadModule perl_module $apache_src/modules/perl/libperl.so" ;
#$EPSTARTUP ='startup_dso.pl' ;
print " + mod_perl was build with USE_DSO\n" ;
- $dynlib->{'OTHERLDFLAGS'} = "-bI:mod_perl.exp -bI:$apache_src/support/httpd.exp" if ($aix);
+ #aixold# $dynlib->{'OTHERLDFLAGS'} = "-bI:mod_perl.exp -bI:$apache_src/support/httpd.exp" if ($aix);
$use_dso = 1 ;
}
+ require Apache::src;
+ $dynlib->{'OTHERLDFLAGS'} = Apache::src->new->otherldflags;
+
if ($EPSTRONGHOLD)
{
@@ -689,6 +692,11 @@
if ($use_dso && $MPVer lt "1.22")
{
print "-> You MUST upgrade to mod_perl 1.22 or higher when mod_perl is build with USE_DSO!!\n" ;
+ $EPSTARTUP ='startup_dso.pl' ;
+ }
+ if ($aix && $MPVer lt "1.22")
+ {
+ print "-> You MUST upgrade to mod_perl 1.22 or higher to use Embperl on AIX!!\n" ;
$EPSTARTUP ='startup_dso.pl' ;
}
}
1.64 +23 -42 embperl/epmain.c
Index: epmain.c
===================================================================
RCS file: /home/cvs/embperl/epmain.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- epmain.c 2000/01/20 20:32:11 1.63
+++ epmain.c 2000/03/29 07:00:39 1.64
@@ -15,9 +15,6 @@
#include "ep.h"
#include "epmacro.h"
-#ifdef _AIX
-#include <sys/ldr.h>
-#endif
/* Version */
@@ -56,7 +53,10 @@
tReq InitialReq ; /* Initial request - holds default values */
tReq * pCurrReq ; /* Set before every eval (NOT thread safe!!) */
-static HV * pCacheHash ; /* Hash which holds all cached data (key=>filename, value=>cache hash for file) */
+static HV * pCacheHash ; /* Hash which holds all cached data
+ (key=> filename or
+ filename + packagename,
+ value=>cache hash for file) */
/* */
/* print error */
@@ -1234,40 +1234,6 @@
req * r = &InitialReq ;
-#if defined(_AIX) && defined(APACHE)
- /*
- * We need to resolve symbols against the main httpd part. The
- * dlopen stub in mod_perl did already call loadbind to resolve
- * all the perl symbols. The Apache dlopen stub does not know
- * about us, so we have to do the loadbind ourselves. The tricky
- * part is here that loadbind does require a pointer to any function
- * in the module to bind against. Fortunately this can be found by
- * querying the system loader for the list of loaded modules, the
- * first is the main part.
- */
- struct ld_info *lp;
- extern boot_HTML__Embperl();
- int len = 4096;
-
- if ((lp = malloc(len)) == NULL) {
- abort();
- }
- while (loadquery(L_GETINFO, lp, len) == -1) {
- if (errno != ENOMEM) {
- abort();
- }
- free(lp);
- len += 4096;
- if ((lp = malloc(len)) == NULL) {
- abort();
- }
- }
- if (loadbind(0, lp->ldinfo_dataorg, (void *)boot_HTML__Embperl) == -1) {
- abort();
- }
- free(lp);
-#endif
-
pCurrReq = r ;
r -> nIOType = _nIOType ;
@@ -1660,12 +1626,23 @@
{
SV * * ppSV ;
tFile * f ;
- char txt [sizeof (sDefaultPackageName) + 50] ;
+ char txt [sizeof (sDefaultPackageName) + 50] ;
+ char * cache_key;
+ int cache_key_len;
EPENTRY (SetupFileData) ;
- /* Have we seen this sourcefile already ? */
- ppSV = hv_fetch(pCacheHash, (char *)sSourcefile, strlen (sSourcefile), 0) ;
+ /* Have we seen this sourcefile/package already ? */
+ cache_key_len = strlen( sSourcefile ) ;
+ if ( pConf->sPackage )
+ cache_key_len += strlen( pConf->sPackage );
+
+ cache_key = _malloc( r, cache_key_len + 1 );
+ strcpy( cache_key, sSourcefile );
+ if ( pConf->sPackage )
+ strcat( cache_key, pConf->sPackage );
+ ppSV = hv_fetch(pCacheHash, cache_key, cache_key_len, 0);
+
if (ppSV && *ppSV)
{
f = (tFile *)SvIV((SV*)SvRV(*ppSV)) ;
@@ -1691,7 +1668,10 @@
else
{ /* create new file structure */
if ((f = malloc (sizeof (*f))) == NULL)
+ {
+ _free(r,cache_key);
return NULL ;
+ }
f -> sSourcefile = sstrdup (sSourcefile) ; /* Name of sourcefile */
f -> mtime = mtime ; /* last modification time of file */
@@ -1713,11 +1693,12 @@
}
f -> nCurrPackage = strlen (f -> sCurrPackage); /* Package of file (length) */
- hv_store(pCacheHash, (char *)sSourcefile, strlen (sSourcefile), newRV_noinc (newSViv ((IV)f)), 0) ;
+ hv_store(pCacheHash, cache_key, cache_key_len, newRV_noinc (newSViv ((IV)f)), 0) ;
if (r -> bDebug)
lprintf (r, "[%d]MEM: Load %s in %s\n", r -> nPid, sSourcefile, f -> sCurrPackage) ;
}
+ _free(r,cache_key);
return f ;
}
1.16 +0 -0 embperl/Embperl/Mail.pm
Index: Mail.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Mail.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Mail.pm 2000/03/29 04:47:07 1.15
+++ Mail.pm 2000/03/29 07:00:41 1.16
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Mail.pm,v 1.15 2000/03/29 04:47:07 richter Exp $
+# $Id: Mail.pm,v 1.16 2000/03/29 07:00:41 richter Exp $
#
###################################################################################
1.17 +0 -0 embperl/Embperl/Module.pm
Index: Module.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Module.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Module.pm 2000/03/29 04:47:07 1.16
+++ Module.pm 2000/03/29 07:00:41 1.17
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Module.pm,v 1.16 2000/03/29 04:47:07 richter Exp $
+# $Id: Module.pm,v 1.17 2000/03/29 07:00:41 richter Exp $
#
###################################################################################
@@ -25,7 +25,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Module.pm,v 1.16 2000/03/29 04:47:07 richter Exp $
+# $Id: Module.pm,v 1.17 2000/03/29 07:00:41 richter Exp $
#
###################################################################################
1.85 +0 -0 embperl/emacs/embperl.el
Index: embperl.el
===================================================================
RCS file: /home/cvs/embperl/emacs/embperl.el,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- embperl.el 2000/03/29 04:47:08 1.84
+++ embperl.el 2000/03/29 07:00:41 1.85
@@ -19,9 +19,9 @@
;; Author : Erik Arneson (erik@mind.net)
;; Created On : Wed Jul 22 17:16:39 PDT 1998
;; Last Modified By: Erik Arneson
-;; Last Modified On: $Date: 2000/03/29 04:47:08 $
+;; Last Modified On: $Date: 2000/03/29 07:00:41 $
;; Version : 1.00
-;; $Id: embperl.el,v 1.84 2000/03/29 04:47:08 richter Exp $
+;; $Id: embperl.el,v 1.85 2000/03/29 07:00:41 richter Exp $
;;
;; Please note that this software is very beta and rather broken. I
;; don't know how useful it will be, although I definitely plan on
1.7 +16 -16 embperl/test/cmp/include.htm
Index: include.htm
===================================================================
RCS file: /home/cvs/embperl/test/cmp/include.htm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- include.htm 2000/03/14 05:15:51 1.6
+++ include.htm 2000/03/29 07:00:42 1.7
@@ -9,31 +9,31 @@
<H1> 1.) Include from memory</H1>
-<P>Here is some text</P>
+<P>Here is some text</P>
<H1> 2.) Include from memory with some Embperl code</H1>
-<table><tr><td>a1</td><td>b2</td><td>c3</td></tr></table></P>
+<table><tr><td>a1</td><td>b2</td><td>c3</td></tr></table></P>
<H1> 3.) Include from memory with passing of variables</H1>
-<P>Transfer some vars Some Var !</P>
+<P>Transfer some vars Some Var !</P>
<H1> 4.) Change the variable, but not the code</H1>
-<P>Transfer some vars Do it again !</P>
+<P>Transfer some vars Do it again !</P>
<H1> 5.) Use \@param to pass parameters</H1>
-<P>Use @param to transfer some data (1 2 3 4) !</P>
+<P>Use @param to transfer some data (1 2 3 4) !</P>
<H1> 6.) Use \@param to pass parameters and return it</H1>
<H3> $p[0] is vara and $p[1] is varb<H3>
-<P>Got data in @param (vara varb) !</P><P>Change data in @param to (newA newB) !</P>
+<P>Got data in @param (vara varb) !</P><P>Change data in @param to (newA newB) !</P>
<H3> $p[0] is now newA and $p[1] is now newB <H3>
<H1> 7.) Presetup \%fdat and \@ffld</H1>
-<P><table><tr><td>fdat</td><td>text</td></tr><tr><td>test</td><td>value</td></tr></table></P>
+<P><table><tr><td>fdat</td><td>text</td></tr><tr><td>test</td><td>value</td></tr></table></P>
<H1> 8.) Inculde a file</H1>
@@ -82,7 +82,7 @@
<P>Ok.<P>
-
+
<H1> 9.) Inculde a file and return output in a scalar</H1>
@@ -132,8 +132,8 @@
$e = 2 <BR>
<P>Ok.<P>
+
-
</H3>
@@ -168,7 +168,7 @@
p0 m1
p1 main
End include
-
+
</td>
</tr>
@@ -200,7 +200,7 @@
p0 m2
p1 main
End include
-
+
</td>
</tr>
@@ -232,7 +232,7 @@
p0 m3
p1 main
End include
-
+
</td>
</tr>
</table>
@@ -246,10 +246,10 @@
Here is param[3] -> dddd<br>
Here is param[4] -> 555<br>
+
-
-<H1> 12.) Inculde a file and write outputfile</H1>
-
+<H1> 12.) Inculde a file and write outputfile</H1>
+
<H1> 12.) Done :-)</H1>
<br>
@@ -261,4 +261,4 @@
</body>
</html>
-
+
1.6 +7 -7 embperl/test/html/include.htm
Index: include.htm
===================================================================
RCS file: /home/cvs/embperl/test/html/include.htm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- include.htm 2000/03/14 05:15:51 1.5
+++ include.htm 2000/03/29 07:00:42 1.6
@@ -132,13 +132,13 @@
[- Execute ('incparam.htm', 0, 'B', 'three', 'dddd', '555') -]
-<H1> 12.) Inculde a file and write outputfile</H1>
-
-[# - Execute ({inputfile => 'inc.htm',
- outputfile => "../tmp/incout.htm",
- }) ;
-- #]
-
+<H1> 12.) Inculde a file and write outputfile</H1>
+
+[# - Execute ({inputfile => 'inc.htm',
+ outputfile => "../tmp/incout.htm",
+ }) ;
+- #]
+
<H1> 12.) Done :-)</H1>
<br>