RE: [users@httpd] CGI help on apache needed

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

 



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:hughw@xxxxxxxxxxxxxxxx] 
Sent: Wednesday, July 05, 2006 11:29 AM
To: users@xxxxxxxxxxxxxxxx
Subject: Re: [users@httpd] 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;
 hugh_williams@xxxxxxxxxxx       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: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


---------------------------------------------------------------------
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: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux