From: Maxim Mamontov Date: Tue, 19 Jul 2016 17:42:17 +0000 (+0300) Subject: Merge branch 'stg-2.409' X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/5ac9b6c2949b075cbb8d8c91dd9f603f3f8ad0a3?ds=sidebyside;hp=-c Merge branch 'stg-2.409' --- 5ac9b6c2949b075cbb8d8c91dd9f603f3f8ad0a3 diff --combined projects/sgconv/build index 1bc23718,1bc23718..3c2f3f91 --- a/projects/sgconv/build +++ b/projects/sgconv/build @@@ -72,7 -72,7 +72,6 @@@ printf " Building sgconv for $sy printf "#############################################################################\n" STG_LIBS="logger.lib -- locker.lib crypto.lib common.lib conffiles.lib diff --combined projects/stargazer/plugins/configuration/sgconfig/configproto.cpp index f012fa1a,567c537a..f5a57a48 --- a/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp @@@ -27,9 -27,7 +27,9 @@@ #include "parser_admins.h" #include "parser_tariffs.h" #include "parser_users.h" +#include "parser_services.h" #include "parser_message.h" +#include "parser_user_info.h" #include "parser_auth_by.h" #include "stg/common.h" @@@ -55,8 -53,6 +55,8 @@@ CONFIGPROTO::CONFIGPROTO(PLUGIN_LOGGER m_admins(NULL), m_tariffs(NULL), m_users(NULL), + m_services(NULL), + m_corporations(NULL), m_store(NULL), m_port(0), m_bindAddress("0.0.0.0"), @@@ -83,7 -79,7 +83,6 @@@ int CONFIGPROTO::Prepare( sigaddset(&sigmask, SIGUSR1); sigaddset(&sigmask, SIGHUP); pthread_sigmask(SIG_BLOCK, &sigmask, &oldmask); -- m_listenSocket = socket(PF_INET, SOCK_STREAM, 0); if (m_listenSocket < 0) @@@ -211,8 -207,6 +210,8 @@@ void CONFIGPROTO::RegisterParsers( assert(m_admins != NULL); assert(m_users != NULL); assert(m_tariffs != NULL); + assert(m_services != NULL); + assert(m_corporations != NULL); SP::GET_SERVER_INFO::FACTORY::Register(m_registry, *m_settings, *m_users, *m_tariffs); @@@ -233,17 -227,9 +232,17 @@@ SP::CHG_USER::FACTORY::Register(m_registry, *m_users, *m_store, *m_tariffs); SP::CHECK_USER::FACTORY::Register(m_registry, *m_users); + SP::GET_SERVICES::FACTORY::Register(m_registry, *m_services); + SP::GET_SERVICE::FACTORY::Register(m_registry, *m_services); + SP::ADD_SERVICE::FACTORY::Register(m_registry, *m_services); + SP::DEL_SERVICE::FACTORY::Register(m_registry, *m_services); + SP::CHG_SERVICE::FACTORY::Register(m_registry, *m_services); + SP::SEND_MESSAGE::FACTORY::Register(m_registry, *m_users); SP::AUTH_BY::FACTORY::Register(m_registry, *m_users); + + SP::USER_INFO::FACTORY::Register(m_registry, *m_users); } int CONFIGPROTO::MaxFD() const diff --combined projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp index 5e61cabb,a7b719ed..138a9ed9 --- a/projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp +++ b/projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp @@@ -31,6 -31,13 +31,13 @@@ #include "firebird_store.h" #include "stg/ibpp.h" + namespace + { + + const int pt_mega = 1024 * 1024; + + } + //----------------------------------------------------------------------------- int FIREBIRD_STORE::GetTariffsList(std::vector * tariffsList) const { @@@ -275,6 -282,7 +282,6 @@@ tr st->Get(3, td->tariffConf.fee); st->Get(4, td->tariffConf.free); st->Get(5, td->tariffConf.passiveCost); - //st->Get(6, td->tariffConf.traffType); td->tariffConf.traffType = TARIFF::IntToTraffType(Get(st, 6)); if (schemaVersion > 0) td->tariffConf.period = TARIFF::StringToPeriod(Get(st, 7)); @@@ -304,8 -312,8 +311,8 @@@ st->Get(7, td->dirPrice[dir].priceNightB); td->dirPrice[dir].priceNightB /= 1024*1024; st->Get(8, td->dirPrice[dir].threshold); - if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) < 1.0e-3 && - std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) < 1.0e-3) + if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) < 1.0e-3 / pt_mega && + std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) < 1.0e-3 / pt_mega) { td->dirPrice[dir].singlePrice = true; } diff --combined projects/stargazer/settings_impl.h index ec8c9cb1,253b8bbc..20d82869 --- a/projects/stargazer/settings_impl.h +++ b/projects/stargazer/settings_impl.h @@@ -42,7 -42,6 +42,6 @@@ #include "stg/settings.h" #include "stg/common.h" - #include "stg/logger.h" #include "stg/module_settings.h" //----------------------------------------------------------------------------- @@@ -85,7 -84,6 +84,7 @@@ public bool GetSpreadFee() const { return spreadFee; } bool GetFreeMbAllowInet() const { return freeMbAllowInet; } bool GetDayFeeIsLastDay() const { return dayFeeIsLastDay; } + bool GetStopOnError() const { return stopOnError; } bool GetWriteFreeMbTraffCost() const { return writeFreeMbTraffCost; } bool GetShowFeeInCash() const { return showFeeInCash; } @@@ -132,7 -130,6 +131,7 @@@ private bool spreadFee; bool freeMbAllowInet; bool dayFeeIsLastDay; + bool stopOnError; bool writeFreeMbTraffCost; bool showFeeInCash; unsigned messageTimeout; diff --combined stglibs/pinger.lib/Makefile index c8c09b3e,c8c09b3e..803f7ac4 --- a/stglibs/pinger.lib/Makefile +++ b/stglibs/pinger.lib/Makefile @@@ -10,8 -10,8 +10,7 @@@ INCS = pinger. LIBS = $(LIB_THREAD) --LIB_INCS = -I ../locker.lib/include \ -- -I ../common.lib/include ++LIB_INCS = -I ../common.lib/include include ../Makefile.in