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

[MacPerl-WebCGI] MacPERL, .acgi's, push, and WebSTAR



Folks,

I just downloaded the WebSTAR 4.0 server suite since that's what our 
host uses (!) and have been testing my scripts locally. I have 
already gathered that MacPERL won't support what I really want to do, 
namely return some placeholder HTML saying "The page is being 
generated (55% done). Come back after some coffee." while actually 
generating the page in another executing script.

So what I planned on doing was a server push that said "The page is 
55% done." and then "The page is 60% done." etc. until it's 100% done 
and then the page would be returned.

No matter what I do, I cannot seem to get WebSTAR to allow me a 
server side push from a script.

The script is started when I attempt to load 
"localhost/theScript.acgi?parameters". A very simplified version of 
the script looks like this:

#!perl

select (STDOUT);
$| = 1;

print "HTTP/1.0 200\n";
print "Content-type: multipart/x-mixed-replace;boundary=flushme\n\n";
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>The Page</TITLE>\n";
print "<META NAME=\"GENERATOR\" CONTENT=\"Hand Made by Bill\">\n";
print "</HEAD>\n";
print "<P>\n";
print "The page is being created. Please visit again in ten minutes. 
Thanks!\n";
print "</HTML>\nflushme";
&Push();
 
sleep(30);
exit;

sub Push {
    local($ignore);

    $ignore = <STDIN>;
}

I've picked up parts of this from various sources, including the 
master, Matthias, himself, and can tell that it's not working right 
because the browser (IE4.5) will just sit until the thirty seconds 
are up and then it displays the HTML. If I could get this simple test 
case to work, my larger script would be easy! (It's always the little 
things....)

The WebSTAR log shows this:
### Received (11):
GET /theScript.acgi HTTP/1.1
Host: localhost
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
image/xbm, image/x-jg, */*
Accept-Language: en
Connection: Keep-Alive
User-Agent: Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)
UA-OS: MacOS
UA-CPU: PPC
Cookie: AECID=lahdeedah
Extension: Security/Remote-Passphrase

Found cached item!
File Found = 1
KEEP-ALIVE on thread 132, connection 11
(ACGI Application) AESend for process 11, err code = 0
Getting ACGI reply string from HandleReply
Push...

.......(a long delay, but not quite 30 seconds, ensues)

Error -1700: Send Partial Data (Reply Data could not be coerced to 
requested type (char))
Error handling HighLevelEvent -1700

.......(at this point, 30 seconds have elapsed and here's what logs:)

WARNING: Stream 11 timed out while awaiting partial ACGI results.
09/25/99	15:23:28	OK  	-	204.60.47.189	Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)		"localhost"	:WWW:comics:theScript.acgi
Con 11: St: Established, Evt: No ASR event, unread 0, Closing
Close took 0 seconds.
CLOSING thread 132, connection 11
Con 11: St: Closed, Evt: No ASR event, unread 0, Closed
Stream 11, File closed already.

version information:
MacPERL version is 5.2.0r4, patch level 5.004, with a CGI plugin by 
some guy named M. Neeracher dated 19Jan97. :)

Can anyone help me with getting WebSTAR to push the data as it's 
ready from my script?

Many thanks,
Bill

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