From: Maxim Mamontov Date: Mon, 8 Nov 2010 10:24:54 +0000 (+0200) Subject: Исправлено неэффективное вычитывание даннх о трафике по направлениям, X-Git-Tag: 2.407-rc3~382 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/9c457d9aee148741ea438b05d3ce8177ca90055e?ds=inline Исправлено неэффективное вычитывание даннх о трафике по направлениям, проведены шаманские обряды с заголовочными файлами. --- diff --git a/projects/stargazer/plugins/store/mysql/mysql_store.cpp b/projects/stargazer/plugins/store/mysql/mysql_store.cpp index 102be151..94503c78 100644 --- a/projects/stargazer/plugins/store/mysql/mysql_store.cpp +++ b/projects/stargazer/plugins/store/mysql/mysql_store.cpp @@ -855,30 +855,29 @@ row = mysql_fetch_row(res); unsigned int startPos=0; char s[22]; -uint64_t traffU[DIR_NUM]; -uint64_t traffD[DIR_NUM]; for (int i = 0; i < DIR_NUM; i++) { + uint64_t traff; sprintf(s, "D%d", i); - if (GetULongLongInt(row[startPos+i*2],&traffD[i], 0) != 0) + if (GetULongLongInt(row[startPos+i*2], &traff, 0) != 0) { mysql_free_result(res); errorStr = "User \'" + login + "\' stat not read. Parameter " + string(s); mysql_close(sock); return -1; } - stat->down = traffD; + stat->down[i] = traff; sprintf(s, "U%d", i); - if (GetULongLongInt(row[startPos+i*2+1], &traffU[i], 0) != 0) + if (GetULongLongInt(row[startPos+i*2+1], &traff, 0) != 0) { mysql_free_result(res); errorStr = "User \'" + login + "\' stat not read. Parameter " + string(s); mysql_close(sock); return -1; } - stat->up = traffU; + stat->up[i] = traff; }//for startPos += (2*DIR_NUM); diff --git a/projects/stargazer/plugins/store/mysql/mysql_store.h b/projects/stargazer/plugins/store/mysql/mysql_store.h index 83a30e6a..649cb858 100644 --- a/projects/stargazer/plugins/store/mysql/mysql_store.h +++ b/projects/stargazer/plugins/store/mysql/mysql_store.h @@ -1,18 +1,19 @@ /* - $Revision: 1.4 $ - $Date: 2010/01/19 11:07:57 $ + $Revision: 1.5 $ + $Date: 2010/10/07 19:45:52 $ */ -#ifndef FILE_STORE_H -#define FILE_STORE_H +#ifndef MYSQL_STORE_H +#define MYSQL_STORE_H + +#include #include #include "base_settings.h" #include "base_store.h" #include "user_traff.h" -#include using namespace std; //-----------------------------------------------------------------------------