• Icon: Sub-task Sub-task
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 2.1.1
    • Repositories
    • Linux
    • Any
    • MOODLE_21_STABLE
    • Hide

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

      Show
      Unluckily none, except applying the attached patch to lib/webdavlib.php
    • 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.

      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.

            poltawski Dan Poltawski
            untoldwind Bodo Junglas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.