From cb2752889f849b293cfe8604455855b8b3fb9481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Guti=C3=A9rrez=20de=20Quevedo=20P=C3=A9?= =?UTF-8?q?rez?= Date: Wed, 26 Mar 2025 13:51:06 +0100 Subject: [PATCH] Remove stats submission --- src/Configfile.cpp.in | 11 ----------- src/hermes.cpp | 32 -------------------------------- 2 files changed, 43 deletions(-) diff --git a/src/Configfile.cpp.in b/src/Configfile.cpp.in index c433de4..d5b61e8 100644 --- a/src/Configfile.cpp.in +++ b/src/Configfile.cpp.in @@ -108,17 +108,6 @@ void Configfile::validateConfig() throw Exception("Directory "+chroot+" doesn't exist, can't chroot to it.",__FILE__,__LINE__); #endif //WIN32 - //check if we have submit_stats on but no user and password - if(getSubmitStats()&&(""==getSubmitStatsUsername()||""==getSubmitStatsPassword())) - throw Exception("You have configured hermes to send stats, but have not configured a username or password.\n" - "If you don't have one, go to http://www.hermes-project.com and register there",__FILE__,__LINE__); - - #ifndef HAVE_SSL - //check if we have activated submit_stats_ssl not having ssl activated - if(getSubmitStatsSsl()) - throw Exception("You have configured stats submission through SSL, but hermes was compiled without SSL support",__FILE__,__LINE__); - #endif //HAVE_SSL - } string Configfile::parseAsString(string str) diff --git a/src/hermes.cpp b/src/hermes.cpp index 9691326..be0e02a 100644 --- a/src/hermes.cpp +++ b/src/hermes.cpp @@ -332,38 +332,6 @@ void *cleaner_thread_run(void *) { LERR("Error cleaning the database: " + string(e)); } - if(spamcount>0&&cfg.getSubmitStats()) - { - try - { - Socket s; - string server_response; - - s.init(); - s.connect("stats.hermes-project.com",11125); - #ifdef HAVE_SSL - if(cfg.getSubmitStatsSsl()) - { - s.writeLine("ssl"); - s.prepareSSL(false); - s.startSSL(false); - } - else - #endif //HAVE_SSL - s.writeLine("non-ssl"); - s.writeLine(cfg.getSubmitStatsUsername()); - s.writeLine(cfg.getSubmitStatsPassword()); - s.writeLine(Utils::inttostr(spamcount)); - server_response=s.readLine(); - s.close(); - if("OK"!=server_response) - throw Exception(server_response,__FILE__,__LINE__); - } - catch(Exception &e) - { - LDEB("Exception sending stats: "+string(e)); - } - } } #ifndef WIN32 if(false==cfg.getBackground())