From:             firewolf at pochtampt dot ru
Operating system: FreeBSD-4.8
PHP version:      4.3.3RC1
PHP Bug Type:     Feature/Change Request
Bug description:  fopen works incorrect with URL

Description:
------------
function fopen(),
when I open http://somesite/somefile
I can't use reget, because server response:
HTTP/1.0 206 Partial content... and php log error.

Its possible when I make content:

$opts = array('http'=>array('user_agent'                                 
=> "USER_AGET NAME\r\nRange: bytes=2000-\r\n"));
$context = stream_context_create($opts);
$fl = fopen("$url","r",false,$context);


Reproduce code:
---------------
php-4.3.3RC1/ext/standard/http_fopen_wrapper.c.orig:
...
line 300: 
switch(response_code) {
                                case 200:
                                case 302:
                                case 301:
                                        reqok = 1;
                                        break;
                                case 403:


Expected result:
----------------
php-4.3.3RC1/ext/standard/http_fopen_wrapper.c.orig:
...
line 300: 
switch(response_code) {
                                case 200:
                                case 206:
                                case 302:
                                case 301:
                                        reqok = 1;
                                        break;
                                case 403:



-- 
Edit bug report at http://bugs.php.net/?id=24505&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=24505&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=24505&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24505&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24505&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24505&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24505&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24505&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24505&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24505&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24505&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24505&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24505&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24505&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24505&r=gnused

Reply via email to