Google the original thread for more <br><br>Note racket has changed significantly since 2008!<br><br><div class="gmail_quote">---------- Forwarded message ---------<br>From: Eddie Sullivan <<a href="mailto:eddieSull@hotmail.com">eddieSull@hotmail.com</a>><br>Date: Wed, 10 Dec 2008 at 19:45<br>Subject: Re: [plt-scheme] Faster CGI<br>To:  <<a href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme@list.cs.brown.edu</a>><br><br><br>If anybody's interested, I've attached a simple wrapper for the FastCGI C<br>
library I hacked up when I was first learning Scheme. As a warning, it's<br>
probably not the best written code, and it's definitely incomplete, but it<br>
may be a starting point.<br>
<br>
I originally wanted to code up the FastCGI protocol from scratch, but the<br>
networking libraries provided with PLT are not low-level enough (I needed<br>
some way to determine what type of port stdin was, to differentiate between<br>
CGI and FCGI).<br>
<br>
Anyway, you should be able to run the same code under FastCGI and regular<br>
CGI. The function "fcgi-loop" takes a no-parameter-function as parameter,<br>
and calls it repeatedly (for FCGI) or once (for CGI). In the case of FCGI,<br>
current-input-port, current-output-port, and current-error-port are<br>
parameterized for the FCGI versions of those ports. It also tries to fake<br>
out the environment variables, but that part's a little hacky.<br>
<br>
The attached fcgi-cgi.scm shows an example use. It's a (F)CGI script that<br>
multiplies the two request parameters num1 and num2.<br>
<br>
Hope it helps.<br>
-Eddie Sullivan<br>
<br>
> From: "Jay McCarthy" <<a href="mailto:jay.mccarthy@gmail.com" target="_blank">jay.mccarthy@gmail.com</a>><br>
> Subject: Re: [plt-scheme] Faster CGI<br>
><br>
> Ah, I understand now. Yes, I would recommend writing something like a<br>
> FastCGI wrapper, I imagine that the protocol is fairly simple, if<br>
> you'd like me to look it over and give any tips on controlling<br>
> resources (i.e., with custodians), I'd be happy to.<br>
><br>
> Jay<br>
><br>
> On Mon, Dec 8, 2008 at 8:27 PM, Henk Boom <<a href="mailto:lunarc.lists@gmail.com" target="_blank">lunarc.lists@gmail.com</a>> wrote:<br>
> > 2008/12/8 Shriram Krishnamurthi <<a href="mailto:sk@cs.brown.edu" target="_blank">sk@cs.brown.edu</a>>:<br>
> >> Yes, that's correct.  But the point is that they make it much more<br>
> >> friendly to use continuations if you so desire (ie, if you haven't<br>
> >> used the server w/ continuations in a year or two, you may want to<br>
> >> check whether these additions pass your necessary benchmarking).<br>
> ><br>
> > Ok, I see that point. If I am going to use the PLT Web Server then it<br>
> > makes sense to investigate those options to make using continuations<br>
> > affordable. The problem I was running into, though, was unaffordable<br>
> > memory usage even in the absence of continuations.<br>
> ><br>
> >    Henk<br>
> ><br>
><br>
> ______________________________<u></u>___________________<br>
  For list-related administrative tasks:<br>
  <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/<u></u>mailman/listinfo/plt-scheme</a><br>
</div>