[spr28657] Re: PortableAserve (and WebActions, specifically)
The Bug Handler <[email protected]> Wed, 3 Mar 2004 18:25:31 -0800
| Newsgroups | gmane.lisp.open-source.franz |
|---|---|
| Message-ID | <[email protected]> |
dispatched to jkf No acknowledgement sent @@id: spr28657 @@reference: @@summary: Re: PortableAserve (and WebActions, specifically) @@product: acl @@version: @@component: allegroserve @@customer-name: Rudi Schlatte @@customer-company: @@customer-phone: @@customer-email-address: [email protected] @@email-cc: opensource, [email protected] @@hardware: @@operating-system-and-version: @@implementation-time: @@state: logged 3/3/2004 by jkf @@state: dispatched 3/3/2004 to jkf by jkf @@endstate ------------------------------------------------------------------------------- @@resolution: ------------------------------------------------------------------------------- @@discussion: Return-Path: owner-opensource Delivery-Date: Mon Mar 1 13:26:30 2004 Received: from turtle.franz.com (192.132.95.23) by tiger.franz.com (Allegro Maild v1.1.9) id 000000039119; Mon, 1 Mar 2004 13:26:30 -0800 Received: (from majordomo@localhost) by turtlemail.franz.com (8.11.6/8.9.0) id i21LP2J17171 for opensource-list; Mon, 1 Mar 2004 13:25:02 -0800 X-Authentication-Warning: turtle.franz.com: majordomo set sender to [email protected] using -f Received: from spider.franz.com (spider [10.2.0.4]) by turtlemail.franz.com (8.11.6/8.9.0) with SMTP id i21LP1E17168 for <opensource-local@turtle>; Mon, 1 Mar 2004 13:25:01 -0800 Received: from smtp-09.inode.at (62.99.194.11) by spider.franz.com (Allegro Maild v1.1.12) id 000000497572; Mon, 1 Mar 2004 13:25:01 -0800 Received: from [62.99.252.74] (port=53753 helo=[62.99.252.74]) by smtp-09.inode.at with asmtp (TLSv1:RC4-SHA:128) (Exim 4.30) id 1AxuB2-0007Y2-Gp; Mon, 01 Mar 2004 21:38:12 +0100 In-Reply-To: <[email protected]> References: <[email protected]> Mime-Version: 1.0 (Apple Message framework v612) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-13--1065451823" Message-Id: <[email protected]> Content-Transfer-Encoding: 7bit Cc: "'[email protected]'" <opensource>, [email protected] From: Rudi Schlatte <[email protected]> Subject: Re: PortableAserve (and WebActions, specifically) Date: Mon, 1 Mar 2004 21:37:59 +0100 To: "Anthony W. Juckel" <[email protected]> X-Pgp-Agent: GPGMail 1.0 (v30, 10.3) X-Mailer: Apple Mail (2.612) X-Fi-Border: spider Sender: owner-opensource Precedence: bulk --Apple-Mail-13--1065451823 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; format=flowed [Cc'ing paserve-discuss; apologies for the full quote, but I think this=20= is of general interest] On 1. M=E4r 2004, at 18:25, Anthony W. Juckel wrote: > I've been using the CVS version of PortableAserve for quite some time,=20= > and was happy to see the inclusion of webactions after ILC2003.=20 > Unfortunately, I noticed a bug in webactions that would not allow you=20= > to nest clp tags. If you say that webactions more-or-less work in paserve, that's good to=20= hear -- I haven't yet used them myself. > For instance, the following would not work properly: > > <test_embedded> > <test_currval/> > <test_embedded> > <test_currval/> > </test_embedded> > </test_embedded> > > And definitions: > > (defvar number-test 0) > (def-clp-function test_embedded (req ent args body) > (let ((number-test (1+ number-test))) > (emit-clp-entity req ent body))) > (def-clp-function test_currval (req ent args body) > (html ((:span :class "test_currval") (:princ number-test)))) > > The problem was, net.aserve::scan-for-end-tag was not taking nested=20 > tags into account. I updated it (probably naively, but it works for=20= > me) to the version in the attached file. Would you consider adding=20 > this (or a similar fix) to the portableaserve CVS repo? > Certainly. But if it's a bug that only manifests itself on=20 _portable_allegroserve, I'd rather see it fixed it in the acl-compat=20 layer. On the other hand, if it's a bug in WebActions itself, it=20 should perhaps be reported upstream. I've Cc'ed the Franz opensource=20 list since they might be interested. Thanks for the bug report, I'll keep you informed. Rudi [not snipping code for the benefit of portableaserve-discuss@sf and=20 opensource@franz ...] > Anthony W. Juckel > (in-package :net.aserve) > (defun scan-for-end-tag (p module fcn) > "Scan for the end tag, taking nested tags into account." > (flet ((tag-name-matches-p (p tag-name) > (dotimes (i (length tag-name) > (let ((ch (peek-char nil p = nil))) > (if (or (eq ch #\ ) > (eq ch #\>)) > (progn > (peek-char #\> = p nil) > (read-char p = nil nil) > (return-from = tag-name-matches-p t)) > (return-from = tag-name-matches-p nil)))) > (let ((ch (read-char p nil nil))) > (when (or (null ch) > (not (eq ch (aref = tag-name i)))) > (return-from tag-name-matches-p = nil)))))) > (let ((tag-name (format nil "~a_~a" module fcn)) > (nest-level 1) > (start-pos (file-position p))) > (loop > (if (peek-char #\< p nil); Take the #\< off the stream > (read-char p nil nil) > (return-from scan-for-end-tag nil)) > (let ((char (peek-char t p nil))) > (cond > ((eq char #\/) > (read-char p nil nil) > (when (and (tag-name-matches-p p tag-name) > (zerop (decf nest-level))) > (return-from scan-for-end-tag (- = (file-position p) > = start-pos > = (length (format nil "</~a>" tag-name)))))) > (t > (when (tag-name-matches-p p tag-name) > (incf nest-level))))))))clx-user)= --Apple-Mail-13--1065451823 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFAQ58u765FppppCGcRAtCSAJ9V9EB7GhJpzxY+iVw/FuEgo1LUcQCg2yVr JNrdvjmCP5GLbEe7fMd1MhE= =8Njk -----END PGP SIGNATURE----- --Apple-Mail-13--1065451823--