nelu / rutorrent-thirdparty-plugins

Plugins for ruTorrent web client, filemanager, fileshare, fileupload, mediastream
59 stars 43 forks source link

FileShare: Error while generating links asynchronously #11

Closed MervinB closed 4 years ago

MervinB commented 8 years ago

When you make multiple requests at the time, it generates only one link (the last one requested in the timeline)

The error is in this file:

https://github.com/nelu/rutorrent-thirdparty-plugins/blob/stable/fileshare/share.class.php

    protected function load() {
        if(!is_file($this->datafile) && !$this->write()) {die('Failed to write file');}

        if(($rf = file_get_contents($this->datafile)) === FALSE) {die('Failed to load data');}
        $this->data = unserialize($rf);
    }
    private function write() {
        return (file_put_contents($this->datafile, serialize($this->data)) !== FALSE);
    }

these functions are load and overwritten the log file without taking into account the concurrency.

nelu commented 8 years ago

i will add a background to the modal window to prevent multiple actions from the same session, this wont cure the serverside issue

nelu commented 4 years ago

plugin deprecated. try the new filemanager plugin