[Zope] fastcgi protocol

Robert Frank Robert.Frank@unibas.ch
Wed, 08 Aug 2001 16:20:47 +0200


Hi,

I'm in the process of writing a Roxen (webserver) module which should  
interface with Zope. I would like to do the same as the fastcgi module does  
for Apache. I have set up a simulation program, which simulates Zope in  
order to get the Roxen module to work. Using the simulation programm  
everything is fine, but when using Zope ....

I need to know what to send to the socket (true TCP, not domain!) and what  
to expect from it. I start Zope with the following options:
  z2.py -X -u 90 -F 4445 -D

Looking at the sources of Zope, I gathered the following:
- open the socket

- send a 10byte header containing the length of the following block
  as zero padded ascii
- send the block containing the environment variables,
  each of the form:
     variable=value\0
- send a 10byte header containing the length of the following block
  as zero padded ascii
- send the block containing the data from the browser (excluding the
  headers).

- wait for a 10byte header containing the length of the following block
  as zero padded ascii
- read the data to be sent to the browser, adding the confirmation line
  (e.g. HTTP 200 OK\r\n)
- wait for a 10byte header containing the length of the following block
  as zero padded ascii
- read the error data

- close the socket

Is this correct? What environment variables are neccessary?

Thanks for any clarification, I really, really hope that someone out there  
can enlighten me and that I can get the module to work!

Robert
-------------------------------------
Institut fuer Informatik           tel  +41 (0)61 267 14 66
Universitaet Basel                 fax. +41 (0)61 267 14 61
Robert Frank
Klingelbergstrasse 50   Robert.Frank@unibas.ch (NeXT,MIME mail ok)
CH-4056 Basel           (remove any no_spam_ from my return address)
Switzerland             http://www.ifi.unibas.ch/~frank