richter 2005/08/06 15:33:57
Modified: . Changes.pod epcomp.c
Embperl Syntax.pm
Embperl/Syntax Mail.pm
test/html mail.htm
Log:
- Fixed mail:send tag (Syntax Mail), so that Perl code inside the tag
for example to set an attribute, is now executed correctly.
Revision Changes Path
1.275 +2 -0 embperl/Changes.pod
Index: Changes.pod
===================================================================
RCS file: /home/cvs/embperl/Changes.pod,v
retrieving revision 1.274
retrieving revision 1.275
diff -u -r1.274 -r1.275
--- Changes.pod 6 Aug 2005 21:47:37 -0000 1.274
+++ Changes.pod 6 Aug 2005 22:33:56 -0000 1.275
@@ -7,6 +7,8 @@
compiles Apache 2 in maintainer mode)
- Fixed strange output when Perl code inside of [$ sub $] returns
before any output.
+ - Fixed mail:send tag (Syntax Mail), so that Perl code inside the tag
+ for example to set an attribute, is now executed correctly.
- Documentation cleanup
=head4 2.0.rc4 19. Juni 2005
1.21 +18 -7 embperl/epcomp.c
Index: epcomp.c
===================================================================
RCS file: /home/cvs/embperl/epcomp.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- epcomp.c 6 Aug 2005 21:47:37 -0000 1.20
+++ epcomp.c 6 Aug 2005 22:33:56 -0000 1.21
@@ -1102,7 +1102,8 @@
if (pCmd -> sMayJump)
if (embperl_CompileToPerlCode (r, pDomTree, pNode, pCmd -> sMayJump,
&sStackValue))
{
- *bCheckpointPending = -1 ;
+ if (*bCheckpointPending <= 0)
+ *bCheckpointPending = -1 ;
if (r -> Component.Config.bDebug & dbgCompile)
lprintf (r -> pApp, "[%d]EPCOMP: #%d L%d Set Checkpoint
pending\n", r -> pThread -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
}
@@ -1138,10 +1139,11 @@
if (r -> Component.Config.bDebug & dbgCompile)
lprintf (r -> pApp, "[%d]EPCOMP: #%d L%d Remove Checkpoint\n", r
-> pThread -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
nCheckpointCodeOffset = 0 ;
- *bCheckpointPending = -1 ; /* set checkpoint on next possibility */
+ if (*bCheckpointPending <= 0)
+ *bCheckpointPending = -1 ; /* set checkpoint on next possibility */
}
- if (*bCheckpointPending && (pNode -> bFlags & nflgIgnore))
+ if (*bCheckpointPending < 0 && (pNode -> bFlags & nflgIgnore))
{
int l ;
char buf [80] ;
@@ -1313,7 +1315,8 @@
if (pCmd -> sPerlCodeEnd && pCmd -> sMayJump)
if (embperl_CompileToPerlCode (r, pDomTree, pNode, pCmd ->
sMayJump, &sStackValue))
{
- *bCheckpointPending = -1 ;
+ if (*bCheckpointPending <= 0)
+ *bCheckpointPending = -1 ;
if (r -> Component.Config.bDebug & dbgCompile)
lprintf (r -> pApp, "[%d]EPCOMP: #%d L%d Set Checkpoint
pending\n", r -> pThread -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
}
@@ -1342,7 +1345,8 @@
if (pCmd -> nSwitchCodeType == 1)
{
r -> Component.pProg = &r -> Component.pProgRun ;
- *bCheckpointPending = -1 ;
+ if (*bCheckpointPending <= 0)
+ *bCheckpointPending = -1 ;
if (r -> Component.Config.bDebug & dbgCompile)
lprintf (r -> pApp, "[%d]EPCOMP: #%d L%d Set Checkpoint
pending (switch to ProgRun)\n", r -> pThread -> nPid, pNode -> xNdx, pNode ->
nLinenumber) ;
}
@@ -1427,7 +1431,7 @@
/* if (*bCheckpointPending && (pNode -> nType == ntypText || pNode ->
nType == ntypCDATA) && pNode -> bFlags && (pNode -> bFlags & nflgIgnore) == 0)
*/
/* if (*bCheckpointPending && pNode -> bFlags && (pNode -> bFlags &
nflgIgnore) == 0) */
- if (*bCheckpointPending && !(pCmd && pCmd -> nSwitchCodeType == 2)
&& pNode -> bFlags && (pNode -> bFlags & nflgIgnore) == 0)
+ if (*bCheckpointPending < 0 && !(pCmd && pCmd -> nSwitchCodeType == 2)
&& pNode -> bFlags && (pNode -> bFlags & nflgIgnore) == 0)
{
int l ;
char buf [80] ;
@@ -1450,8 +1454,12 @@
nCheckpointCodeOffset = 0 ;
}
- if (pCmd == NULL || (pCmd -> bRemoveNode & 8) == 0)
+ if (pCmd == NULL || (pCmd -> bRemoveNode & 8) == 0 || (pCmd ->
bRemoveNode & 64))
{ /* calculate attributes before tag, but not when tag should be
ignored in output stream */
+ int bSaveCP = *bCheckpointPending ;
+ if (pCmd && (pCmd -> bRemoveNode & 64))
+ *bCheckpointPending = 1 ;
+
while ((pAttr = Element_selfGetNthAttribut (r -> pApp, pDomTree,
pNode, nAttr++)))
{
if (pAttr -> bFlags & aflgAttrChilds)
@@ -1471,6 +1479,9 @@
}
}
+ if (pCmd && (pCmd -> bRemoveNode & 64))
+ *bCheckpointPending = bSaveCP ;
+
}
1.5 +7 -1 embperl/Embperl/Syntax.pm
Index: Syntax.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Syntax.pm 14 Mar 2004 18:54:43 -0000 1.4
+++ Syntax.pm 6 Aug 2005 22:33:57 -0000 1.5
@@ -823,6 +823,12 @@
Set all child nodes to ignore for output.
+=item 64
+
+Calculate Attributes values of this node also for nodes that are set to
ignore for output
+(makes only sense if 8 is also set).
+
+
=back
=item removespaces => <removeflags>
1.5 +2 -2 embperl/Embperl/Syntax/Mail.pm
Index: Mail.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Mail.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Mail.pm 23 Jan 2004 06:50:57 -0000 1.4
+++ Mail.pm 6 Aug 2005 22:33:57 -0000 1.5
@@ -70,7 +70,7 @@
$self -> AddTagBlock ('mail:send', ['from', 'to', 'cc', 'bcc',
'subject', 'reply-to',
'mailhost', 'mailhelo',
'maildebug'], undef, undef,
{
- removenode => 42,
+ removenode => 106,
compiletimeperlcode => q{
$_ep_mail_opt_save =
$Embperl::req->component->config->options ;
$Embperl::req->component->config->options
(Embperl::Constant::optKeepSpaces | $_ep_mail_opt_save) ;
1.3 +6 -1 embperl/test/html/mail.htm
Index: mail.htm
===================================================================
RCS file: /home/cvs/embperl/test/html/mail.htm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mail.htm 20 Nov 2002 06:56:28 -0000 1.2
+++ mail.htm 6 Aug 2005 22:33:57 -0000 1.3
@@ -5,11 +5,16 @@
</head>
<body>
+ [-
+ $fdat{Email} = '[EMAIL PROTECTED]' ;
+ -]
[$ syntax + Mail $]
- <mail:send to="[EMAIL PROTECTED]" subject="Testmail"
mailhost="mail.i.ecos.de">
+ <mail:send to="[EMAIL PROTECTED]"
+ [$ if $fdat{Email} $] reply-to="[+ $fdat{Email} +]" [$endif$]
+ subject="Testmail" mailhost="mail.i.ecos.de">
Hi,
this is a test for a new mail tag
it is send at [+ scalar(localtime) +]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]