I'm trying to convert my CGI scripts to FCGI to improve performance since my scripts do a lot of database calls, and FCGI keeps the database connection open. But I understand that if I use the "exit;" command in my script, that closes the connection to the database and the script has to start over again from scratch the next time it's called. That kind of defeats the purpose of using FCGI.
So, how do I do a graceful exit? If I had just one exit test then I could change this:
[b]if ($badData) { exit;}[/b]
to this:
[b]if (!$badData) {
[long code block]
}[/b]
...but I have a *bunch* of exit tests throughout the script. If I went the above route I'd be nesting DO blocks within DO blocks within DO blocks, and it would be pretty ugly.
What am I missing?