Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Apache Problem

by Anonymous Monk
on Mar 03, 2000 at 21:12 UTC ( [id://4795]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

If a user hits stop in his browser, the Perl cgi is killed. I would like to know how this works and how to catch the termination in order to have time to clean up a few things. I have tried to catch all the signals I knew but it doesn't seem to work that way. Could sby give me some help on this ? Thanks.

Replies are listed 'Best First'.
Re: Apache Problem
by btrott (Parson) on Mar 03, 2000 at 23:21 UTC
    If you're running under mod_perl, take a look at this section of the mod_perl guide and the Apache::SIG module.
Re: Apache Problem
by Crulx (Monk) on Mar 04, 2000 at 06:08 UTC
    btrott's answer is correct. If you are not using mod_perl or Apache::SIG (i.e. you don't have any control over the webserver used) Then you have to catch SIGPIPE on stdout. Set up your program to do this and you should be ok. Basically, you just have to catch the signal on the perl side of things before the web server's handler does the work for you.
    ---
    Crulx
    crulx@iaxs.net

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://4795]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-19 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found