If your internet connection fails, the server doesn't know the connection is down until the server times out trying to send the response. The response is only sent once the CGI finished running, so the the your internet connection failing does not stop the CGI from running.
If you press the stop button, I don't know what happens.
| [reply] |
If you press the stop button, I don't know what happens.
You end the http transaction
| [reply] |
If you read the OP's question, you'll see it pertains to the effect on the CGI script. What you posted says nothing about what happens to the CGI script. Does it get killed? Does it get sent a signal? If so, what's the default action of that signal? Does its STDOUT get closed?
| [reply] |
From what little information you have given, I assume your perl interpreter is on the server. In any case a perl script should keep on running until it gets to the end, whether that end is the end of the script, a fatal exception or a call to die.
Do you have a more specific question, like: 'What happens to the output?' Or: 'Will a rogue perl script kill the server?' If so, you need to tell us what is actually going on.
How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist. Robot Tourist, by Ten Benson
| [reply] |
Hi.
Let's say my perl script counts from 1 to 1,000,000 using for(...). If I type the url of my script on my browser - http://xxx.xxx.xxx/cgi-bin/count.cgi - and press enter, the perl script then starts counting to 1,000,000. My question is that if my internet connection gets interrupted when count.cgi is only at, say, 500,000, does the perl script continue counting until 1,000,000 or does it stop at 500,000 or somewhere near there and prematurely end? By "interrupted" I mean totally disconnected (e.g. dog bites off my ethernet cable, plane crashes into my building or my computer explodes) Of course, the server where my script resides is miles away and will be safe as part of the givens of my scenario. Thanks in advance for your reply!
Gorby
| [reply] |
Not even if you are sending the intermediate count and expecting it to be received. The script will finish executing no matter what happens to the browser. What will happen is that the browser will not accept the result page from the server (if you even send one... you didn't mention that) and the server will add an error note to its log. All of this is irrelevant to the Perl program, though. The only things that would cause it not to successfully complete would be a _server_ hardware problem or a deliberate kill signal. Even if your cgi is sending an updated ("refreshed") page every second with the latest count, the counting itself would not be interrupted unless you were expecting your user to physically click a button for each update.
There's a lot missing from your question, so I'd suggest that you spend a bit of time thinking and reading about how a webserver, a browser, and the web operate.
| [reply] |