Changeset 1214


Ignore:
Timestamp:
01/14/10 07:54:25 (11 years ago)
Author:
landlord
Message:

Parameter 'hideclients_to' switched from minutes to seconds, backport of 'monitor-improvement' branch

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Distribution/doc/man/oscam.conf.5

    r1181 r1214  
    161161.RE
    162162.PP
    163 \fBhideclient_to\fP = \fBminutes\fP
     163\fBhideclient_to\fP = \fBseconds\fP
    164164.RS 3n
    165165time to hide clients in the monitor if not sending requests, 0 = disabled, default:0
  • trunk/Distribution/doc/txt/oscam.conf.txt

    r1181 r1214  
    118118      monlevel can be overwritten per user in oscam.user
    119119
    120        hideclient_to = minutes
     120       hideclient_to = seconds
    121121      time to hide clients in the monitor if not  sending  requests,  0  =
    122122      disabled, default:0
  • trunk/module-monitor.c

    r1137 r1214  
    339339}
    340340
    341 static void monitor_process_info()
    342 {
    343   int i;
    344   time_t now;
    345 
    346   now=time((time_t)0);
    347   for (i=0; i<CS_MAXPID; i++)
    348     if ((cfg->mon_hideclient_to <= 0) ||
    349         (((now-client[i].lastecm)/60)<cfg->mon_hideclient_to) ||
    350         (((now-client[i].lastemm)/60)<cfg->mon_hideclient_to) ||
    351         (client[i].typ!='c'))
    352       if (client[i].pid)
    353       {
    354         if ((client[cs_idx].monlvl<2) && (client[i].typ!='s'))
    355         {
    356           if ((strcmp(client[cs_idx].usr, client[i].usr)) ||
    357               ((client[i].typ!='c') && (client[i].typ!='m')))
    358             continue;
    359         }
    360         monitor_send_info(monitor_client_info('I', i), 0);
    361       }
    362   monitor_send_info(NULL, 1);
    363 }
     341static void monitor_process_info(){
     342    int i;
     343    time_t now = time((time_t)0);
     344
     345    for (i = 0; i < CS_MAXPID; i++){
     346        if  ((cfg->mon_hideclient_to <= 0) ||
     347                ( now-client[i].lastecm < cfg->mon_hideclient_to) ||
     348                ( now-client[i].lastemm < cfg->mon_hideclient_to) ||
     349                ( client[i].typ != 'c')){
     350            if (client[i].pid) {
     351                if ((client[cs_idx].monlvl < 2) && (client[i].typ != 's')) {
     352                    if  ((strcmp(client[cs_idx].usr, client[i].usr)) ||
     353                            ((client[i].typ != 'c') && (client[i].typ != 'm')))
     354                        continue;
     355                }
     356            monitor_send_info(monitor_client_info('I', i), 0);
     357            }
     358        }
     359    }
     360    monitor_send_info(NULL, 1);
     361}
    364362
    365363static void monitor_send_details(char *txt, int pid)
Note: See TracChangeset for help on using the changeset viewer.