#26440 [Opn->Asn]: headers not passed in stream context
| From: | sniper@php.net | Date: | Thu, 27 Nov 2003 23:11:49 +0000 |
| Subject: | #26440 [Opn->Asn]: headers not passed in stream context | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-51182@lists.php.net to get a copy of this message | ||
ID: 26440
Updated by: sniper@php.net
Reported By: steven at pearavenue dot com
-Status: Open
+Status: Assigned
Bug Type: HTTP related
Operating System: Linux
-PHP Version: 4.3.4
+PHP Version: 4CVS, 5CVS
-Assigned To:
+Assigned To: wez
New Comment:
PHP_4_3: Reproduced with latest CVS, here's some leaks:
/usr/src/web/php/php4/Zend/zend_hash.c(450) : Freeing 0x086510CC (64
bytes), script=t.php
/usr/src/web/php/php4/Zend/zend_hash.c(416) : Freeing 0x08651074 (35
bytes), script=t.php
Last leak repeated 8 times
/usr/src/web/php/php4/ext/standard/file.c(616) : Freeing 0x086505AC
(44 bytes), script=t.php
/usr/src/web/php/php4/Zend/zend_variables.c(122) : Actual location
(location was relayed)
/usr/src/web/php/php4/ext/standard/file.c(997) : Freeing 0x08650494
(44 bytes), script=t.php
/usr/src/web/php/php4/Zend/zend_API.c(562) : Actual location (location
was relayed)
/usr/src/web/php/php4/ext/standard/http_fopen_wrapper.c(372) : Freeing
0x08650EAC (25 bytes), script=t.php
Last leak repeated 7 times
/usr/src/web/php/php4/ext/standard/http_fopen_wrapper.c(370) : Freeing
0x08650E6C (12 bytes), script=t.php
Last leak repeated 7 times
/usr/src/web/php/php4/ext/standard/http_fopen_wrapper.c(316) : Freeing
0x086502F4 (18 bytes), script=t.php
/usr/src/web/php/php4/ext/standard/http_fopen_wrapper.c(296) : Freeing
0x086502B4 (12 bytes), script=t.php
/usr/src/web/php/php4/Zend/zend_hash.c(188) : Freeing 0x0864DD1C (32
bytes), script=t.php
/usr/src/web/php/php4/ext/standard/file.c(614) : Freeing 0x0864DC9C
(12 bytes), script=t.php
/usr/src/web/php/php4/main/streams.c(2884) : Freeing 0x08652A44 (57
bytes), script=t.php
/usr/src/web/php/php4/Zend/zend_variables.c(111) : Actual location
(location was relayed)
/usr/src/web/php/php4/main/streams.c(2882) : Freeing 0x08652A04 (12
bytes), script=t.php
Seems to work with HEAD, but still some leaks:
/usr/src/web/php/php5/main/streams/streams.c(1694) : Freeing
0x40E49B98 (57 bytes), script=t.php
/usr/src/web/php/php5/Zend/zend_variables.c(137) : Actual location
(location was relayed)
/usr/src/web/php/php5/main/streams/streams.c(1692) : Freeing
0x40E49B54 (16 bytes), script=t.php
=== Total 2 memory leaks detected ===
Previous Comments:
------------------------------------------------------------------------
[2003-11-27 17:10:36] steven at pearavenue dot com
Of course, I don't mean a 304 "error" - I mean a 304 response
------------------------------------------------------------------------
[2003-11-27 17:03:06] steven at pearavenue dot com
Description:
------------
Context passed to fopen does not appear to include header in request.
Reproduce code:
---------------
$uri = 'http://www.what-it-all-means.com/index.rdf';
$agent = "First-Say-RSS-AGGREGATOR/0.0.2.4 http://www.firstsay.net";
$since = 'Thu, 27 Nov 2003 06:03:08 GMT';
$etag = '"7051a-36a7-3fc5939c"';
$opts = array(
'http' => array(
'method' => "GET",
'header' => "If-None-Match: $etag\r\n".
"If-Modified-Since: $since\r\n",
'user_agent' => $agent
)
);
$context = stream_context_create($opts);
$fp = @fopen($uri, 'rb', false, $context);
if (!is_resource($fp)) {
echo "error";
}
var_dump(stream_context_get_options($fp) );
echo "\n:::::\n";
var_dump ( stream_get_meta_data($fp) );
fclose($fp);
Expected result:
----------------
With the appropriate URL, http-date and etag (you may have to change
those above) this should produce a 304 error
Actual result:
--------------
produces a 200, as though the header is ignored.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26440&edit=1