unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* guile-www-2.9 (www cgi) does not support mod-lisp/fastcgi style uses
@ 2005-04-11 23:44 Alan Grover
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Grover @ 2005-04-11 23:44 UTC (permalink / raw)


guile-www-2.9 (www cgi) captures the CGI Environment once. If the 
containing process is called to serve a subsequent request, the values 
will usually be wrong. The current implementation is not friendly to 
mod-lisp/fastcgi uses (or testing!).

Module: www cgi
Version: 2.9

The *env-alist* constructs an alist at module-load time, composed of 
delayed "getenv" calls. Thus, while the values are not captured at 
module-load time, they are memoized the first time they are accessed.

"The value of the promise is cached (or "memoized") so that if it is 
forced a second time, the previously computed value is returned" [r5rs, 
Control Features]. I could find no mechanism to un-memoize.

Note that this may lead to different CGI values being captured during 
different requests. For example, the first request may capture the URI, 
the next request may capture its PATH-INFO, and so on.

I don't know the behavior of promises in threads, so I do not know if 
the module will misbehave in a threaded-server model.

There may be other values that are not re-initialized by "init", I have 
not attempted to be comprehensive.

A suggest patch that resets the promises at "init" time is:

cgi.scm

43c43,45
< (define *env-alist*
---
 > (define *env-alist* #f)
 > (define (make-env-alist)
 >  (set! *env-alist*
98c100
<                                 #\, types)))))))))
---
 >                                 #\, types))))))))))
117a120
 >   (make-env-alist)
 >   (set! form-variables '())

I'm working on a suggested change to (www cgi) that will include this 
patch. It should be available within the next 2 days.

-- 
Alan Grover
awgrover@mail.msen.com
+1.734.476.0969


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: guile-www-2.9 (www cgi) does not support mod-lisp/fastcgi style uses
@ 2005-04-12  2:34 Thien-Thi Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Thien-Thi Nguyen @ 2005-04-12  2:34 UTC (permalink / raw)
  Cc: bug-guile

   From: Alan Grover <awgrover@mail.msen.com>
   Date: Mon, 11 Apr 2005 19:44:37 -0400

   [patch]

   I'm working on a suggested change to (www cgi) that will
   include this patch. It should be available within the
   next 2 days.

i've just installed changes to the env var support.  the
gist is that promises are no longer used, there is a hash
table instead of the alist, and the table is updated on
every call to `cgi:init'.  i think this should be enough to
support fastcgi, but have not tested it.

btw, anoncvs instructions are in dir:
http://www.glug.org/people/ttn/software/guile-www/

thi


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-12  2:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-11 23:44 guile-www-2.9 (www cgi) does not support mod-lisp/fastcgi style uses Alan Grover
  -- strict thread matches above, loose matches on Subject: below --
2005-04-12  2:34 Thien-Thi Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).