Home » HTTP » HTTP_WebDAV_Client » Bug #6407
stream_read(): Range one byte too long
Details
| 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) |
Comments
[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