ID:               44716
 Updated by:       [EMAIL PROTECTED]
-Summary:          progress notifications incorrec
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Closed
 Bug Type:         Streams related
 Operating System: Linux
 PHP Version:      5.2.5
-Assigned To:      
+Assigned To:      bjori
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2008-04-14 12:14:36] [EMAIL PROTECTED]

Description:
------------
The stream progress notifications are reporting twice as high numbers
(and twice as often) as they should.


Reproduce code:
---------------
<?php

function stream_notification_callback($notification_code, $severity,
$message, $message_code, $bytes_transferred, $bytes_max) {
    switch($notification_code) {
        case STREAM_NOTIFY_PROGRESS:
                        var_dump($bytes_transferred);
            break;
    }
}

$ctx = stream_context_create();
stream_context_set_params($ctx, array("notification" =>
"stream_notification_callback"));

$str =
file_get_contents("http://no.php.net/get/php_manual_en.tar.gz/from/this/mirror";,
null, $ctx, 0, 8192);
var_dump(strlen($str));

echo "\nDone!\n";



Expected result:
----------------
int(0)
int(0)
int(1440)
int(2880)
int(4320)
int(5760)
int(7200)
int(8192)

Done!


Actual result:
--------------
int(0)
int(0)
int(1440)
int(2880)
int(4320)
int(5760)
int(7200)
int(8640)
int(10080)
int(11520)
int(12960)
int(14400)
int(8192)



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=44716&edit=1

Reply via email to