Forum Moderators: open
I am facing timeout problem while using popup window.
i have perl script, in form field i am executing .cgi script and calling validate() function on submit. the validate function is implemented using javascript which creats popup window.
The popup window is giving "Page cannot be displayed" message after exactly 60 minutes,my .cgi takes around 90 minutes to complete.now User thinks operation is terminated how to resolve this issue?
can any one help on this issue.
Thanks & Regards
RajathM
90 minutes is unbelievable. Somewhere you have to have a recursive function or you're on the world's worse web server. I'd approach this first by eliminating Javascript entirely in a test form. Post directly to a test version of the perl script.
If this fixes it, go back to your Javascript and begin adding alerts:
function validate () {
for (i=0;i<validation_list;i++) {
alert(validation_list[i]);
}
}
If it still hangs after eliminating Javascript, go into your perl script and begin adding print statements. Start with this at the top:
print "content-type:text/html\n\n";
Then throughout the script, add something like this at key points:
print "top of script<br>\n";
....
print "read/parse<br>\n";
....
print "validate function<br>\n";
....
print "input to database<br>\n";
And so on. Find the problem first, then you know where to look.
if ($pid = fork) { &return_html_response; }
# Spawn child process
else { &perform_intensive_function; }
Fork spawns the child process, allowing it to run in the background, while the parent process immediately returns a response to the browser.