如何绕过stream_select失败“过滤”的http流?

时间:2012-10-03 15:46:27

标签: php http stream

我正在stream_select'http流上尝试fopen()。但是,stream_select一直给我这些错误,而选择失败。

Warning: stream_select(): cannot cast a filtered stream on this system
Warning: stream_select(): cannot cast a filtered stream on this system
Warning: stream_select(): cannot cast a filtered stream on this system
Warning: stream_select(): No stream arrays were passed

流创建如下:

$ctx = array(..) // valid context, data is returned ok.
$fh = fopen($url,'r',NULL,$ctx);
// Result: resource(70) of type (stream)

那么,究竟什么是过滤流,为什么http流被认为是这样,有什么方法可以绕过它? stream_select的文档说“无法选择某些流,例如zlib”,但没有提及http。

修改:在与Google和PHP文档交谈后,我尝试从流中查询元数据以查看是否指定了任何过滤器,答案为否:没有{{1}元数据中的索引,表示此流是无过滤的。

filters

0 个答案:

没有答案