Re: Proposal: Check if script has been aborted (for apache)

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: Proposal: Check if script has been aborted (for apache)
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-3611@lists.php.net to get a copy of this message
> > This issue is a bit vague right now. My original thought here was that we > > would just checked Apache's r->connection->aborted flag. But this doesn't > > actually work. In PHP4 we have to make sure that we check the return code > > from every read/write operation. > > has anybody checked with the apache guys if this is supposed to work.... Yes, of course. There is some confusion there as well and it has to do with whether we are in a hard_timeout vs. a soft_timeout. Basically the answer is that we can't rely on r->connection->aborted getting set. > i will do an "initial" shot on this later this week and let you guys know what > happens... > > my approach would be to create a new global (like error_reporting) that will > be reset on each request start. > > i would then include return-value checking in PHPWRITE(), php3_flush(), > php3_apache_putc() and php3_apache_puts(). PHPWRITE needs to be converted to a > function (to check the error AND return the size written). if an error occurs > i would just set my new variable (which you can get via a php3 api-function). > > that way we would have NO changes in the behaviour of scripts (no "output pipe > closed....")- but get the benefit of beeing able to check if everyrthing that > was supposed to be written actually got written..... > > any sugesstions?? That's probably a good start. You can have a look at where we currently check for connection->aborted and stick a check for your global there to properly terminate the script. I am not certain this is the right approach, but having another pair of eyes go through and check this stuff will be good. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#3611) next »