• Resolved nenesse8

    (@nenesse8)


    Since version 4.9.0, the plugin uses the Transfer-Encoding:chunked header instead of Content-Length.
    This leads to incompatibility with Kaspersky antivirus (“Safe browsing” functionality with default configuration) when the file to download is small.

    Example: when I try to download a pdf file of 50kb, the download does not take place and in the console we see

    “** An error occurred during the transaction” and “net::ERR_CONNECTION_RESET 200 (OK)”

    The problem did not arise in version 4.8.10. It also does not arise in version 4.9.0 having deactivated the antivirus beforehand.
    Is it possible not to use this header for small files or to provide an option to not use it at all?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter nenesse8

    (@nenesse8)

    note: it seems more easily reproducible with Chrome

    Plugin Author Razvan Aldea

    (@raldea89)

    Hello,

    Regarding that header it was not introduced in version 4.9.0 nor in version 4.9.1 ( 4.9.1 was a patch that solved a database problem, so nothing regarding headers – it is weird that on 4.9.0 it works and 4.9.1 not ).

    Does downgrading to 4.8.10 solve the problem?

    Warmly,
    Razvan

    Thread Starter nenesse8

    (@nenesse8)

    Indeed. I must have done something wrong because I no longer reproduce this difference.
    I tried downloading small pdf files (30kb) again using the following configuration:

    • Chrome in private mode and opening a new window for each test
    • no extension except DLM
    • default WP theme
    • no cache remaining on the server

    in version 4.8.10: OK (with and without antivirus)
    in version 4.9.2: OK except when the antivirus is activated

    everything becomes OK again if I reinstall version 4.8.10.

    in version 4.9.2, when the antivirus is deactivated, I manage to produce the same result by clicking many times extremely quickly on the download link.
    in version 4.8.10, I can’t do it.

    I can’t reproduce the problem with Firefox.

    Thread Starter nenesse8

    (@nenesse8)

    Hello

    The problem is here: https://github.com/WPChill/download-monitor/blob/master/src/DownloadHandler.php#L880

    Is ob_flush() required? I don’t see ob_start() above.
    In version 4.9.2, downloading a file of a few MB (without error) generates numerous traces on the server like
    [06-Nov-2023 20:59:39 UTC] PHP Notice: ob_flush(): failed to flush buffer. No buffer to flush in /var/www/tst/wp-content/plugins/download-monitor/src/DownloadHandler.php on line 880

    By deleting this line or replacing it with
    if ( ob_get_level() > 0 ) {
    ob_flush();
    }

    the problem is solved.

    • This reply was modified 1 year ago by nenesse8.
    • This reply was modified 1 year ago by nenesse8.
    Plugin Author Razvan Aldea

    (@raldea89)

    Thank you for the info, we’ll include a fix for this in the next update. For the moment you can delete that line from the plugin so that the downloads work. The update will probably be launched this week.

    Warmly,
    Razvan

    JamesGTMoore

    (@jamesgtmoore)

    I get this error too. My version of the plugin is 4.9.2. Example page with a download link https://blog.futureofmankind.co.uk/2023/09/18/automating-oracle-rman-backups/

    Best regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Error downloading small files’ is closed to new replies.