Re: HTTP_download -If-Modified-Since (->304) does not work
| From: | Andreas Korthaus | Date: | Fri, 19 Dec 2003 20:15:34 +0000 |
| Subject: | Re: HTTP_download -If-Modified-Since (->304) does not work | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24556@lists.php.net to get a copy of this message | ||
Hi!
"Michael Wallner" <mike@php.net> wrote in
news:20031219195152.11539.qmail@pb1.pair.com...
> > But should "raise error" be used for logging?
> > Perhaps I should not exit after each raise-error?
> >
> > btw., the error which happend there was not raised, it was a sucess
message,
> > but it did not succeed in reality.
> Sorry, I didn't understand fully what you're talking about, but
> let me try to explan a bit:
My bad english, sorry ;-)
What I wanted to say (I try again ;-)):
return PEAR::raiseError(
'HTTP Cached: ' . HTTP_HEADER_STATUS_304
);
This error is raised every time if someone requests a file which has not
been modified since last visit. So HTTP_download answerws with 304
Statuscode and the client will take the file form its own cache.
But this is not an error. Other statuscodes as 4xx or 2xx could be errors
but not 304. It is a normal behaviour.
So if a 304 is sent, everything is OK, something like that will be logged
in httpd access_log, not error_log.
But I want to log real errors, so how could I differ between a real HTTP
Error as Statuscode 416, and an 304 Statuscode, which is _not_ an error
whish should be logged?
after HTTP_download::send(), I should use "exit;" by myself, if I don't want
any processing after sending the file/statuscode, right?
> o If HTTP_Download is going to send _nothing_ to the client, it will raise
an error.
It will _always_ raise an error if not Statuscode 200, but 304 is nearly the
same as 200 in result.
> The patch corrects the latter until I've figured out what Wolfram intended
> with the currently funny implementation of HTTP_Header::sendStatusCode(),
> AFAIR this was patched Davey.
Thanks a lot for your patch!
> So stay tuned, and be sure that I thank you very much for your report!
no problem.
Regards,
Andreas