Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.1.1
    • Fix Version/s: None
    • Component/s: Repositories
    • Labels:
    • Environment:
      Linux
    • Database:
      Any
    • Testing Instructions:
      Hide

      Setup a WebDAV server on some external server (NOT on your own development machine; simple Apache mod_dav will do), upload a SCORM Package there and try to download it with Moodle as WebDAV repository.

      Show
      Setup a WebDAV server on some external server (NOT on your own development machine; simple Apache mod_dav will do), upload a SCORM Package there and try to download it with Moodle as WebDAV repository.
    • Workaround:
      Hide

      Unluckily none, except applying the attached patch to lib/webdavlib.php

      Show
      Unluckily none, except applying the attached patch to lib/webdavlib.php
    • Affected Branches:
      MOODLE_21_STABLE

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              poltawski Dan Poltawski
              Reporter:
              untoldwind Bodo Junglas
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: