-
Sub-task
-
Resolution: Duplicate
-
Major
-
None
-
2.1.1
-
Linux
-
Any
-
MOODLE_21_STABLE
-
-
Download of the SCORM Packages via WebDAV is just not working when using an external WebDAV server (i.e. somewhere in the internet).
If using a WebDAV-Server near to the Moodle installation (i.e. on the same machine) everything is working fine. The problem only occurs when using real internet Sockets.
Some of the other open webdav issues may be related to this (though I'm not entirely sure).
More in detail:
The bug is deep inside the webdavlib.php. One of the key-points is e.g. here:
if ($chunk_size > 0) {
|
$buffer .= fread($this->sock,$chunk_size);
|
}
|
At this point it is implicitly assumed that fread will actually read exactly $chunk_size bytes. Now do a little RTFM in PHP documentation:
string fread ( resource $handle , int $length )
|
|
fread() reads *UP TO* length bytes from the file pointer referenced by handle.
|
I.e. in the example above: When using local sockets fread actually reads exactly $chunk_size, on a real socket fread usually ready something < $chunk_size
Seriously: I don't see how this code could have ever worked correctly.
- duplicates
-
MDL-30154 WebDAV-Repository fails on some WebDAV-Server
- Closed