Re: Proposal: Check if script has been aborted (for apache)
| From: | Thies C. Arntzen | Date: | Mon, 18 Jan 1999 16:07:50 +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-3610@lists.php.net to get a copy of this message | ||
Rasmus Lerdorf wrote:
> > but we could error-check every write/flush to the client and set a
> > global variable if it failed. that way a script could check if the data
> > could be delivered completely - at least to apache....(i want to do
> > accounting on COMPLETE download of hi-res photos).
>
> 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....
>
>
> > i had a short look thru the sources and i believe it could be done by
> > changing PHPWRITE, php3_flush() etc....
> >
> > is that something you think would be useful and worth digging into????
>
> Yes, it probably would be useful investigating this further, although a
> change at this stage in PHP3 at this level of the code would have to be
> *extremely* well-tested.
>
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??
tc
>
> -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
--
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