Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.2

Bug #6407 stream_read(): Range one byte too long
Submitted: 2006-01-03 12:16 UTC Modified: 2006-03-01 10:47 UTC
From: knight_k at gmx dot de Assigned: hholzgra
Status: Closed Package: HTTP_WebDAV_Client
PHP Version: Irrelevant OS: WinXP
Roadmaps: (Not assigned)    
Subscription  


 [2006-01-03 12:16 UTC] knight_k at gmx dot de
Description: ------------ Php gives a warning (see below), that one byte too much is read (which actually is, i think) That's because of the following lines in stream_read($count): $end = $start+$count; [...] $req->addHeader("Range", "bytes=$start-$end"); because of "Range" including the $start-offset, it is one byte too long, so it should be $end = $start+$count-1; to fix this. Test script: --------------- require_once('HTTP/WebDAV/Client.php'); copy("webdav://webdavserver.net/foo.bar","foo.bar"); Actual result: -------------- the warning: "PHP Warning: copy(): HTTP_WebDAV_Client_Stream::stream_read - read 1 bytes more data than requested (8193 read, 8192 max) - excess data will be lost [...]" and a corrupted file

Comments

 [2006-03-01 10:47 UTC] hholzgra
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.