• Rob Swindell's avatar
    Fix uploader-notification, credit awards, download-counters in FTP downloads · 8e94a448
    Rob Swindell authored
    Since v3.19 (the new filebases), when a user FTP-downloaded a file, we failed
    to properly find/load that file's record from the filebase (searching for the
    file's full path, rather than just the filename), so the code the increments
    the file's download counter, notifies the uploader, awards credits, etc. did
    not ever execute. This means that FTP-downloads for all files downloaded via
    FTP were effectively "free" (and nobody noticed). No error was logged either.
    I discovered this while debugging the case of "(null)" filenames in the
    action/download MQTT topic messages being published by the FTP server. So
    that issue is fixed as part of this commit as well.
    Oh, and if this code had executed before, it would have memory-leaked the
    file information, so that's fixed too (added call to smb_freefilemem). Ugh.