Changeset 7555
- Timestamp:
- 10/01/12 17:53:27 (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/global-functions.h
r7554 r7555 50 50 extern void cs_restart_oscam(void); 51 51 extern int32_t cs_get_restartmode(void); 52 extern void clear_account_stats(struct s_auth *account);53 extern void clear_all_account_stats(void);54 extern void clear_system_stats(void);55 52 56 53 int32_t restart_cardreader(struct s_reader *rdr, int32_t restart); -
trunk/module-webif.c
r7553 r7555 2125 2125 } 2126 2126 2127 static void clear_account_stats(struct s_auth *account) { 2128 account->cwfound = 0; 2129 account->cwcache = 0; 2130 account->cwnot = 0; 2131 account->cwtun = 0; 2132 account->cwignored = 0; 2133 account->cwtout = 0; 2134 account->emmok = 0; 2135 account->emmnok = 0; 2136 cacheex_clear_account_stats(account); 2137 } 2138 2139 void clear_all_account_stats(void) { 2140 struct s_auth *account = cfg.account; 2141 while (account) { 2142 clear_account_stats(account); 2143 account = account->next; 2144 } 2145 } 2146 2147 void clear_system_stats(void) { 2148 first_client->cwfound = 0; 2149 first_client->cwcache = 0; 2150 first_client->cwnot = 0; 2151 first_client->cwtun = 0; 2152 first_client->cwignored = 0; 2153 first_client->cwtout = 0; 2154 first_client->emmok = 0; 2155 first_client->emmnok = 0; 2156 cacheex_clear_client_stats(first_client); 2157 } 2158 2127 2159 static char *send_oscam_user_config(struct templatevars *vars, struct uriparams *params, int32_t apicall) { 2128 2160 struct s_auth *account; -
trunk/oscam.c
r7553 r7555 162 162 } 163 163 164 static void cs_reset_lastresponsetime(struct s_client *cl) { 165 (void)cl; 164 166 #ifdef WEBIF 165 void cs_add_lastresponsetime(struct s_client *cl, int32_t ltime, time_t timestamp, int32_t rc){ 166 167 int32_t i; 168 for(i = 0; i < CS_ECM_RINGBUFFER_MAX; i++) { 169 cl->cwlastresptimes[i].duration = 0; 170 cl->cwlastresptimes[i].timestamp = time((time_t*)0); 171 cl->cwlastresptimes[i].rc = 0; 172 } 173 cl->cwlastresptimes_last = 0; 174 #endif 175 } 176 177 static void cs_add_lastresponsetime(struct s_client *cl, int32_t ltime, time_t timestamp, int32_t rc){ 178 (void)cl; (void)ltime; (void)timestamp; (void)rc; 179 #ifdef WEBIF 167 180 if(cl->cwlastresptimes_last == CS_ECM_RINGBUFFER_MAX - 1){ 168 181 cl->cwlastresptimes_last = 0; … … 173 186 cl->cwlastresptimes[cl->cwlastresptimes_last].timestamp = timestamp; 174 187 cl->cwlastresptimes[cl->cwlastresptimes_last].rc = rc; 175 } 176 #endif 188 #endif 189 } 177 190 178 191 /***************************************************************************** … … 398 411 } 399 412 400 #ifdef WEBIF401 void clear_account_stats(struct s_auth *account)402 {403 account->cwfound = 0;404 account->cwcache = 0;405 account->cwnot = 0;406 account->cwtun = 0;407 account->cwignored = 0;408 account->cwtout = 0;409 account->emmok = 0;410 account->emmnok = 0;411 cacheex_clear_account_stats(account);412 }413 414 void clear_all_account_stats(void)415 {416 struct s_auth *account = cfg.account;417 while (account) {418 clear_account_stats(account);419 account = account->next;420 }421 }422 423 void clear_system_stats(void)424 {425 first_client->cwfound = 0;426 first_client->cwcache = 0;427 first_client->cwnot = 0;428 first_client->cwtun = 0;429 first_client->cwignored = 0;430 first_client->cwtout = 0;431 first_client->emmok = 0;432 first_client->emmnok = 0;433 cacheex_clear_client_stats(first_client);434 }435 #endif436 437 413 void cs_accounts_chk(void) 438 414 { … … 1032 1008 memcpy(&cl->ctab, &account->ctab, sizeof(cl->ctab)); 1033 1009 memcpy(&cl->ttab, &account->ttab, sizeof(cl->ttab)); 1034 #ifdef WEBIF 1035 int32_t i; 1036 for(i = 0; i < CS_ECM_RINGBUFFER_MAX; i++) { 1037 cl->cwlastresptimes[i].duration = 0; 1038 cl->cwlastresptimes[i].timestamp = time((time_t*)0); 1039 cl->cwlastresptimes[i].rc = 0; 1040 } 1041 cl->cwlastresptimes_last = 0; 1042 #endif 1010 1011 cs_reset_lastresponsetime(cl); 1043 1012 if (account->uniq) 1044 1013 cs_fake_client(cl, account->usr, (account->uniq == 1 || account->uniq == 2)?account->uniq+2:account->uniq, cl->ip); … … 2117 2086 client->cwlastresptime = 1000 * (tpe.time-er->tps.time) + tpe.millitm-er->tps.millitm; 2118 2087 2119 #ifdef WEBIF2120 2088 cs_add_lastresponsetime(client, client->cwlastresptime,time((time_t*)0) ,er->rc); // add to ringbuffer 2121 #endif2122 2089 2123 2090 if (er_reader){ … … 2125 2092 if(er_cl){ 2126 2093 er_cl->cwlastresptime = client->cwlastresptime; 2127 #ifdef WEBIF2128 2094 cs_add_lastresponsetime(er_cl, client->cwlastresptime,time((time_t*)0) ,er->rc); 2129 #endif2130 2095 er_cl->last_srvidptr=client->last_srvidptr; 2131 2096 }
Note:
See TracChangeset
for help on using the changeset viewer.