|
|
@ -70,12 +70,14 @@ static char *session_stat_get_stsfile(s_faddr *addr, int linenum)
|
|
|
|
|
|
|
|
|
|
|
|
static int session_stat_read_stsfile(FILE *fp, s_sess_stat *stat)
|
|
|
|
static int session_stat_read_stsfile(FILE *fp, s_sess_stat *stat)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
int res;
|
|
|
|
|
|
|
|
|
|
|
|
if( fseek(fp, 0, SEEK_SET) == -1 )
|
|
|
|
if( fseek(fp, 0, SEEK_SET) == -1 )
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
memset(stat, '\0', sizeof(s_sess_stat));
|
|
|
|
memset(stat, '\0', sizeof(s_sess_stat));
|
|
|
|
|
|
|
|
|
|
|
|
fscanf(fp, "%u %u %u %u %u %u %lu %lu %lu %lu",
|
|
|
|
res = fscanf(fp, "%u %u %u %u %u %u %lu %lu %lu %lu",
|
|
|
|
(unsigned int *) &stat->tries,
|
|
|
|
(unsigned int *) &stat->tries,
|
|
|
|
(unsigned int *) &stat->tries_noconn,
|
|
|
|
(unsigned int *) &stat->tries_noconn,
|
|
|
|
(unsigned int *) &stat->tries_noansw,
|
|
|
|
(unsigned int *) &stat->tries_noansw,
|
|
|
@ -86,7 +88,10 @@ static int session_stat_read_stsfile(FILE *fp, s_sess_stat *stat)
|
|
|
|
(unsigned long *) &stat->hold_freqs,
|
|
|
|
(unsigned long *) &stat->hold_freqs,
|
|
|
|
(unsigned long *) &stat->last_success_out,
|
|
|
|
(unsigned long *) &stat->last_success_out,
|
|
|
|
(unsigned long *) &stat->last_success_in);
|
|
|
|
(unsigned long *) &stat->last_success_in);
|
|
|
|
|
|
|
|
if (res == 0) {
|
|
|
|
|
|
|
|
log("Read STS unsuccessfull...");
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
/* Set last successfull session time */
|
|
|
|
/* Set last successfull session time */
|
|
|
|
stat->last_success = MAX(stat->last_success_out, stat->last_success_in);
|
|
|
|
stat->last_success = MAX(stat->last_success_out, stat->last_success_in);
|
|
|
|
|
|
|
|
|
|
|
|