]> git.stg.codes - stg.git/commitdiff
Merge branch 'stg-2.409'
authorMaxim Mamontov <faust.madf@gmail.com>
Tue, 19 Jul 2016 17:42:17 +0000 (20:42 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Tue, 19 Jul 2016 17:42:17 +0000 (20:42 +0300)
1  2 
projects/sgconv/build
projects/stargazer/plugins/configuration/sgconfig/configproto.cpp
projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp
projects/stargazer/settings_impl.h
stglibs/pinger.lib/Makefile

diff --combined projects/sgconv/build
index 1bc23718283273258ff76eaaca402b2592ebb7d9,1bc23718283273258ff76eaaca402b2592ebb7d9..3c2f3f91367aae62e8cf88fdf6c9b47cc1e17228
@@@ -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
index f012fa1a7e6c1a192ddc5b8beb6691f7c62a117b,567c537ae7f6a5aaef04ef641ff1ff77da829db6..f5a57a48ca11a6c377620b0892481335d4e3f7ef
@@@ -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);
  
      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
index 5e61cabbe451e42f43a62d653077002c00d4e005,a7b719edb3eb5847e9191da4bb8aba6def298712..138a9ed92a8a72a2c13086b168e0ccf286165b0e
  #include "firebird_store.h"
  #include "stg/ibpp.h"
  
+ namespace
+ {
+ const int pt_mega = 1024 * 1024;
+ }
  //-----------------------------------------------------------------------------
  int FIREBIRD_STORE::GetTariffsList(std::vector<std::string> * 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<int>(st, 6));
      if (schemaVersion > 0)
          td->tariffConf.period = TARIFF::StringToPeriod(Get<std::string>(st, 7));
      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;
          }
index ec8c9cb17d22c72bdd115fb68470a024131109fb,253b8bbccbcc70c0a41d4b09e464780b60c32b90..20d82869983fc78e1871814645eec496d874a169
@@@ -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;
index c8c09b3e7ec258005800aefbb153cb94a255a5d9,c8c09b3e7ec258005800aefbb153cb94a255a5d9..803f7ac4edffd2464652fe8547937b35b0f42bad
@@@ -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