Changeset 1021


Ignore:
Timestamp:
01/01/10 14:35:25 (12 years ago)
Author:
alno
Message:

Webif:

  • Statusview columns CWok and CWnok added
  • Reader settings "device" missin comma added
  • http server improvement
Location:
branches/monitor-improvement
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/monitor-improvement/oscam-http.c

    r1019 r1021  
    673673    tpl_printf(vars, 0, "BOXID", "%ld", reader[ridx].boxid);
    674674
    675     if(reader[ridx].r_port) tpl_printf(vars, 0, "R_PORT", "%d", reader[ridx].r_port);
    676     if(reader[ridx].l_port) tpl_printf(vars, 0, "L_PORT", "%d", reader[ridx].l_port);
     675    if(reader[ridx].r_port) tpl_printf(vars, 0, "R_PORT", ",%d", reader[ridx].r_port);
     676    if(reader[ridx].l_port) {
     677        if(reader[ridx].r_port) tpl_printf(vars, 0, "L_PORT", ",%d", reader[ridx].l_port);
     678        else tpl_printf(vars, 0, "L_PORT", ",,%d", reader[ridx].l_port);
     679    }
    677680
    678681    //Group
     
    10151018            tpl_printf(vars, 0, "CLIENTIDLESECS", "%d", isec);
    10161019            tpl_printf(vars, 0, "CLIENTCON", "%d", con);
     1020                tpl_printf(vars, 0, "CWOK", "%d", client[i].cwfound);
     1021                tpl_printf(vars, 0, "CWNOK", "%d", client[i].cwnot);
    10171022            tpl_addVar(vars, 1, "CLIENTSTATUS", tpl_getTpl(vars, "CLIENTSTATUSBIT"));
    10181023        }
     
    10631068}
    10641069
    1065 int process_request(FILE *f) {
     1070int process_request(FILE *f, struct in_addr in) {
    10661071  char buf[4096];
    10671072  char tmp[4096];
     
    12081213    int i,sock;
    12091214    struct sockaddr_in sin;
     1215    struct sockaddr_in remote;
     1216    socklen_t len;
    12101217    char *tmp;
    12111218
     
    12221229
    12231230    /* Startup server */
    1224     if((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0){
     1231    if((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0){
    12251232        cs_log("HTTP Server: Creating socket failed! (errno=%d)", errno);
    12261233        return;
    12271234    }
     1235    memset(&sin, 0, sizeof sin);
    12281236    sin.sin_family = AF_INET;
    12291237    sin.sin_addr.s_addr = INADDR_ANY;
     
    12441252        int s;
    12451253        FILE *f;
    1246         if((s = accept(sock, NULL, NULL)) < 0){
     1254        if((s = accept(sock, (struct sockaddr *) &remote, &len)) < 0){
    12471255            cs_log("HTTP Server: Error calling accept() (errno=%d).", errno);
    12481256            break;
     
    12501258
    12511259        f = fdopen(s, "r+");
    1252         process_request(f);
     1260        process_request(f, remote.sin_addr);
    12531261        fflush(f);
    12541262        fclose(f);
  • branches/monitor-improvement/oscam-http.h

    r1019 r1021  
    5454##TPLMENU##\n\
    5555<BR><BR><TABLE WIDTH=\"100%\" cellspacing=\"0\" class=\"status\">\n\
    56 <TR><TH>PID</TH><TH>Typ</TH><TH>ID</TH><TH>Label</TH><TH>AU</TH><TH>0</TH><TH>Address</TH><TH>Port</TH><TH>Protocol</TH><TH>Login</TH><TH>Login</TH><TH>Time</TH><TH>caid:srvid</TH><TH>Last Channel</TH><TH>Idle</TH><TH>0</TH>\n\
     56<TR><TH>PID</TH><TH>Typ</TH><TH>ID</TH><TH>Label</TH><TH>AU</TH><TH>0</TH><TH>Address</TH><TH>Port</TH><TH>Protocol</TH><TH>Login</TH><TH>Login</TH><TH>Time</TH><TH>caid:srvid</TH><TH>Last Channel</TH><TH>Idle</TH><TH>CWOK</TH><TH>CWNOK</TH><TH>0</TH>\n\
    5757##CLIENTSTATUS##\
    5858</TABLE><BR>\n\
     
    6161</DIV>\n\
    6262##TPLFOOTER##"
    63 #define TPLCLIENTSTATUSBIT "<TR class=\"##CLIENTTYPE##\"><TD>##CLIENTPID##</TD><TD>##CLIENTTYPE##</TD><TD>##CLIENTCNR##</TD><TD>##CLIENTUSER##</TD><TD>##CLIENTCAU##</TD><TD>##CLIENTCRYPTED##</TD><TD>##CLIENTIP##</TD><TD>##CLIENTPORT##</TD><TD>##CLIENTPROTO##</TD><TD>##CLIENTLOGINDATE##</TD><TD>##CLIENTLOGINTIME##</TD><TD>##CLIENTLOGINSECS##</TD><TD>##CLIENTCAID##:##CLIENTSRVID##</TD><TD>##CLIENTSRVNAME##</TD><TD>##CLIENTIDLESECS##</TD><TD>##CLIENTCON##</TD></TR>"
     63#define TPLCLIENTSTATUSBIT "<TR class=\"##CLIENTTYPE##\"><TD>##CLIENTPID##</TD><TD>##CLIENTTYPE##</TD><TD>##CLIENTCNR##</TD><TD>##CLIENTUSER##</TD><TD>##CLIENTCAU##</TD><TD>##CLIENTCRYPTED##</TD><TD>##CLIENTIP##</TD><TD>##CLIENTPORT##</TD><TD>##CLIENTPROTO##</TD><TD>##CLIENTLOGINDATE##</TD><TD>##CLIENTLOGINTIME##</TD><TD>##CLIENTLOGINSECS##</TD><TD>##CLIENTCAID##:##CLIENTSRVID##</TD><TD>##CLIENTSRVNAME##</TD><TD>##CLIENTIDLESECS##</TD><TD>##CWOK##</TD><TD>##CWNOK##</TD><TD>##CLIENTCON##</TD></TR>"
    6464#define TPLUSERCONFIGLIST "##TPLHEADER##\
    6565##TPLMENU##\n\
     
    219219void send_footer(FILE *f);
    220220void send_oscam_menu(FILE *f);
    221 void send_oscam_user_config(struct templatevars *vars, FILE *f, struct uriparams *params);
    222221char *getParam(struct uriparams *params, char *name);
Note: See TracChangeset for help on using the changeset viewer.