Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Gazelle (http://www.bvlist.com/forumdisplay.php?f=40)
-   -   Failure: Unregistered torrent (http://www.bvlist.com/showthread.php?t=8361)

meltdown 9th October 2012 21:26

Failure: Unregistered torrent
 
Ubuntu 12.04.1 + NGINX + Mysql +sphinx 2.0.5
Gazelle Latest Git version +
Testing Ocelot 0.3.2 and 0.5 and 0.5.1

New uploaded file, the same problem occurs

Failure: Unregistered torrent <-- utorrnet and transmission

but ocelot processor killed after restart normal operation.

What is the problem? plz :sos:

ajax 11th October 2012 03:40

What is the problem, can U tell it more clearly?
Maybe Ocelot configured wrong? Or after server restart u forgot to start it? :chch:

adrian21 13th May 2015 19:28

Same problem here. Aver a new torrent is uploaded you have to restart ocelot otherwise you wil have Unregistered torrent.

How can we fix this? It's annoying to restart it after a new torrent is uploaded.

DND 13th May 2015 19:33

3 yrs old thread.. bug fixed long time ago.. use the latest version of ocelot. damn !:coffee:

adrian21 13th May 2015 19:47

I have the latest form git https://github.com/whatcd/ocelot
After restart the torrent is ok.

Code:

#include
#include
#include
#include "config.h"
#include "misc_functions.h"

confval::confval() {
        bool_val = 0;
        uint_val = 0;
        str_val = "";
        val_type = CONF_NONEXISTENT;
}

confval::confval(bool value) {
        bool_val = value;
        val_type = CONF_BOOL;
}

confval::confval(unsigned int value) {
        uint_val = value;
        val_type = CONF_UINT;
}

confval::confval(const char * value) {
        str_val = value;
        val_type = CONF_STR;
}

bool confval::get_bool() {
        return bool_val;
}

unsigned int confval::get_uint() {
        return uint_val;
}

std::string confval::get_str() {
        return str_val;
}

void confval::set(const std::string &value) {
        if (val_type == CONF_BOOL) {
                bool_val = value == "1" || value == "true" || value == "yes";
        } else if (val_type == CONF_UINT) {
                uint_val = strtoint32(value);
        } else if (val_type == CONF_STR) {
                str_val = value;
        }
}

config::config() {
        init();
        dummy_setting = new confval(); // Safety value to use if we're accessing nonexistent settings
}

void config::init() {
        // Internal stuff
        add("listen_port", 2710u);
        add("max_connections", 1024u);
        add("max_middlemen", 20000u);
        add("max_read_buffer", 4096u);
        add("connection_timeout", 10u);
        add("keepalive_timeout", 0u);

        // Tracker requests
        add("announce_interval", 1800u);
        add("max_request_size", 4096u);
        add("numwant_limit", 50u);
        add("request_log_size", 500u);

        // Timers
        add("del_reason_lifetime", 86400u);
        add("peers_timeout", 7200u);
        add("reap_peers_interval", 1800u);
        add("schedule_interval", 3u);

        // MySQL
        add("mysql_db", "gazelle");
        add("mysql_host", "localhost");
        add("mysql_username", "######");
        add("mysql_password", "#######");

        // Site communication
        add("site_host", "127.0.0.1");
        add("site_path", "/home/admin/domains/#######/public_html/dl/");
        add("site_password", "asaeotrahsaswerfdasitreasctrsk");
        add("report_password", "asaeotrahsaswerfdasitreasctrsk");

        // Debugging
        add("readonly", false);
}

confval * config::get(const std::string &setting_name) {
        const auto setting = settings.find(setting_name);
        if (setting == settings.end()) {
                std::cout << "WARNING: Unrecognized setting '" << setting_name << "'" << std::endl;
                return dummy_setting;
        }
        return &setting->second;
}

bool config::get_bool(const std::string &setting_name) {
        return get(setting_name)->get_bool();
}

unsigned int config::get_uint(const std::string &setting_name) {
        return get(setting_name)->get_uint();
}

std::string config::get_str(const std::string &setting_name) {
        return get(setting_name)->get_str();
}

void config::set(const std::string &setting_name, const std::string &value) {
        get(setting_name)->set(value);
}

void config::load(const std::string &conf_file_path, std::istream &conf_file) {
        load(conf_file);
        add("conf_file_path", conf_file_path.c_str());
}

void config::load(std::istream &conf_file) {
        std::string line;
        while (getline(conf_file, line)) {
                size_t pos;
                if (line[0] != '#' && (pos = line.find('=')) != std::string::npos) {
                        std::string key(trim(line.substr(0, pos)));
                        std::string value(trim(line.substr(pos + 1)));
                        set(key, value);
                }
        }
}

void config::reload() {
        const std::string conf_file_path(get_str("conf_file_path"));
        std::ifstream conf_file(conf_file_path);
        if (conf_file.fail()) {
                std::cout << "Config file '" << conf_file_path << "' couldn't be opened" << std::endl;
        } else {
                init();
                load(conf_file);
        }
}

std::string config::trim(const std::string str) {
        size_t ltrim = str.find_first_not_of(" \t");
        if (ltrim == std::string::npos) {
                ltrim = 0;
        }
        size_t rtrim = str.find_last_not_of(" \t");
        if (ltrim != 0 || rtrim != str.length() - 1) {
                return str.substr(ltrim, rtrim - ltrim + 1);
        }
        return str;
}


PHP Code:

// Ocelot details
define('TRACKER_HOST''127.0.0.1');
define('TRACKER_PORT'2710);
define('TRACKER_SECRET''asaeotrahsaswerfdasitreasctrsk'); // Must be 32 characters and match site_password in Ocelot's config.cpp
define('TRACKER_REPORTKEY''asaeotrahsaswerfdasitreasctrsk'); // Must be 32 characters and match report_password in Ocelot's config.cpp 


DND 13th May 2015 20:41

is it me or the keys are 31 chars and not 32?

adrian21 13th May 2015 23:59

Yes, that was the problem. Thanks a lot! :sos:


All times are GMT +2. The time now is 02:36.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.