[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] acgi vs cgi



irons@espresso.hampshire.edu (Nat Irons)
>My confusion is the difference, in Macperl's case, between .cgi (which I
>understand queues incoming requests and executes them sequentially) and
>.acgi (which from your description appears to do the same).  Am I missing
>something, or does acgi simply not mean much to MacPerl circa 1997?

As the long discussion on this point has shown, this is indeed a good
question. My disinterest in CGI writing beyond providing the basic mechanism
has led to a confusion of the knowledge about the CGI extension up to the point
where probably 90% of the users are willing to believe that the CGI extension
sprung forth from the feverish imagination of the Mad Arab Abdul Alhazred.

To let some light into the mechanics of the CGI extension, I've put the C
source online at

ftp://err.ethz.ch/pub/neeri/MacPerl/Beta/MPCGI_src_09Nov97.sit.bin

This will *NOT* let you compile the code, just examine it.

To answer two immediate questions:

1) How do the CGI extension/MacPerl handle CGIs and ACGIs differently?

CGIs only return when the Perl script has termianted, returning the entire
output of the script, and no amount of $| setting will change this.

ACGIs return an acknowledgment to the WWW server immediately. Data is then
pushed to the server
 - When the script terminates.
 - When the script reads from STDIN more than CONTENT_SIZE bytes, i.e.:
     $push = <STDIN>;
   Will push all data *that has been flushed (through the $| mechanism)
   to the WWW server.

Nothing except server push is different between CGI and ACGI handling.

2) How do I observe the execution of a Perl CGI script.

Start it, and then press command-L. A log file will appear on the desktop.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
  "I suggest a new word:  "reticulomancy" (divining by means of a net)."
                                                     -- Richard A. O'Keefe

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch