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

[MacPerl-WebCGI] Another MacPerl CGI Problem: has anyone seen this?



In working on my Perl Monthly chapter, I keep doing tests, and I just 
ran across another problem with MacPerl CGIs:

As I and others have pointed out for some time, the .acgi extension 
should not be used on a public web server because a second hit on an 
.acgi while a first hit is still executing will result in  "bad 
stuff", varying from a dropped hit to a system crash.  It turns out 
that the .cgi extension is not safe either.

If you have two MacPerl CGIs:

perlscript1.cgi
perlscript2.cgi

If you hit perscript1.cgi and then hit it again while it is still 
running, you second hit is queued and all is well (if slow).

If you hit perlscript1.cgi and then hit perlscript2.cgi while 
perlscript1.cgi is still executing, "bad stuff" happens.  I assume 
that the details of this "bad stuff" can be system dependent, but on 
my system (MacOS8, Quid Pro Quo 2.1) the second hit is dropped, the 
perlscript2.cgi will never quit and won't quit in response to its 
"Quit Now" button, and becomes inert, unable to respond to any 
further requests.  Walking over to the Mac Server, bringing 
perlscript2.cgi to the front, and doing a command-option-escape force 
quit seems to fix everything, but again this is probably system 
dependent and may make that server unstable - probably leaving it at 
"bad stuff" is the most accurate.

This actually makes sense: the .cgi extension warns Quid Pro Quo not 
to try perlscript1.cgi again until it has finished the last 
operation, but there is no way for Quid Pro Quo to know that 
perlscript1.cgi and perlscript2.cgi both depend on MacPerl, so it 
cannot protect you.

I think a workaround is not to have more than one MacPerl CGI on the 
server.  This is not as bad as it sounds in that you can have that 
one CGI do many functions depending on the value of an HTML variable; 
I frequently do that anyway and like to name the HTML variable 
"do_what" :-)

Am I missing something?

Has anyone else seen this?

-David-
David Steffen, Ph.D.
President, Biomedical Computing, Inc. <http://www.biomedcomp.com/>
Phone: (713) 610-9770 FAX: (713) 610-9769 E-mail: steffen@biomedcomp.com

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org