extending ignore_errors inside http_fopen_wrappers.c
| From: | Tjerk Anne Meesters | Date: | Fri, 15 May 2009 14:16:06 +0000 |
| Subject: | extending ignore_errors inside http_fopen_wrappers.c | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-43986@lists.php.net to get a copy of this message | ||
Hi,
I've been extending the pecl/oauth code to work with php stream
wrappers in cases whereby curl is not enabled, but I've hit a snag.
The documentation states that enabling the "ignore_errors" flag will
fetch the content even on failure status codes. At the same time,
setting "max_redirects" to <= 1 indicates that no redirects will be
followed.
It does not state that setting "max_redirects" <= 1 would actually
trigger an error, though in the code it returns (php_stream *)NULL
making it impossible to even get the headers out of the wrapperdata
hash unless STREAM_ONLY_GET_HEADERS is used.
So, either setting "max_redirects" <= 1 should not throw NULL back
into the caller code or "ignore_error" behaviour should be extended to
prevent that from happening.
My attached patch favours to fix the latter, since the "ignore_errors"
is a relatively new flag. Hope it will be accepted for the 5.3
release.
(not sure whether attachments will be allowed ... give me a ping if it
doesn't make it through)
Best,
Tjerk