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 17:16 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  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 48 + 2 = ?

 
 [2006-01-03 17: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 15: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.