Affects Version/s: 2.1.1
Fix Version/s: None
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:
At this point it is implicitly assumed that fread will actually read exactly $chunk_size bytes. Now do a little RTFM in PHP documentation:
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.