php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44716 Progress notifications incorrect
Submitted: 2008-04-14 12:14 UTC Modified: 2008-04-14 12:19 UTC
From: bjori@php.net Assigned: bjori (profile)
Status: Closed Package: Streams related
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
 [2008-04-14 12:14 UTC] bjori@php.net
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)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-14 12:19 UTC] bjori@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC