Intrestingly,

Even if CGI is told to print instantly, the apache knows that the "long
job" is doing something and might need to print out. This is why it
waits for the "long job" to be over before it releases the STDOUT pipe.

I thought I will fork it, close the PIPE on child which is supposed to
do the long job so that apache doesn't wait for it. 

At this time child will continue to do the long job. Apache releases the
pipe held by the parent and IE dislays the new page.

Interestingly, it is not helping

Raj




-----Original Message-----
From: Hugh Williams [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 05, 2006 11:29 AM
To: users@httpd.apache.org
Subject: Re: [EMAIL PROTECTED] CGI help on apache needed

Is there really a need to use forking?  Instead, how about:

 1. CGI prints instant reply.
 2. CGI execs long job (you *are* using exec and not system, right?),
and 
     exits.
 3. long job sends mail (exec or system or a subroutine) when it's done.

You'd need to pass $loginid to the long job of course.

hugh

Rajat Sharma wrote:
> 
> Script looks something like below
> 
> 1. print ("Location: http://XYZ:9090/Project/filepath.html\n\n";);
> 2. close(STDOUT);
> 3. my $pid = fork;
> 
> 4. $pid = 0 unless defined $pid;   # be the kid if fork failed
> 
> 5. exit 0 if $pid;
> 
> ## child...
> 
> 6. close(STDOUT);
> 
> ### LONG DIRTY JOB START
> 7. exec "la_results.pl $input{'dirPath'} $checkboxString";
> ### LONG DIRTY JOB OVER
> 
> 8. mail.pl $loginId ## MAIL THE NOTIFICATION
> 
> Issue is that the after submit of the page, the IE still keeps loading
> the page until the long\dirty job is over.

-- 
 Hugh Williams                  "There are two things to aim for in
life;
 [EMAIL PROTECTED]       first, to get what you want; and after
that,
 Agilent Technologies            to enjoy it.  Only the wisest of
mankind
 Santa Rosa 2US-C                achieve the second."
 707.577.4941                         - Logan Pearsall Smith, 1931

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to