20180913_jeffrey - silenceuncrio/diary GitHub Wiki

0910

M300 土耳其的客戶 xentino 想看一下他們彩色的 logo 出現在我們 web ui 上的樣子

先 build 一版 xentino 的版本

把原本的 logo 從

image

換成彩色的

image

不過因為彩色的 logo 上下留白的關係

先調整一下 css 讓大小相近

proscend/prosrc/www/brand_xentino/brand/custom.css

@@ -17,7 +17,7 @@ body {

 .navbar-custom .navbar-brand {
   height: 50px;
-  padding: 12px 15px 12px 15px;
+  padding: 8px 15px 6px 15px;^M
 }
 .navbar-custom .navbar-brand > img {
   height: 100%;

1010

剛剛 土耳其 更換 logo 應該換在 MR402-LG 的版本上

直接拿 release 的 MR402-LG_019B00721722C2AE_mfgtools.zip 作燒錄

記得抓個圖給 ariel 讓她回信

xentino -MR402-LG white logo image

xentino -MR402-LG color logo image

1040

回到 M360

先 upgrade 成最新的 image

M360 明天一大早就要 release 了

今天針對 web module 的 重構 是不是太冒險了呢

回到 M300 重構好像是較適合

切回 M300 吧

1125

就把 create_daemon_conf() 刪除當作 refactoring 的開始吧

proscend/prosrc/icos/icoslib/web/webcfg.c

@@ -595,73 +595,6 @@ static void gen_key_files(void)



-static int create_daemon_conf(DAEMON_CTRL_T *dmn_ctrl)
-{
-    sWebConfig   *cfg=&gWebCtrl.cfg;
-    FILE  *fp;
-    char cmd_buf[256];
-    char cfg_file[256];
-
-    WEB_INFO("IN\n");
-    snprintf(cfg_file,sizeof(cfg_file),WEB_DAEMON_CFG_FILE,(DID_HTTPD==dmn_ctrl->did)?"d":"s"); //httpd or https
-    if(NULL==(fp=fopen(cfg_file,"w")))
-    {
-        WEB_ERR("Can't create file(%s).\n",cfg_file);
-        return ICOS_FAILURE;
-    }
-
-    //#host=0.0.0.0
-    //dir=/
-    snprintf(cmd_buf,sizeof(cmd_buf),"dir=/\n");
-    WEB_INFO("cmd_buf=>%s",cmd_buf);
-    fprintf(fp,cmd_buf);
-
-    //cgipat=cgi-bin/**
-    snprintf(cmd_buf,sizeof(cmd_buf),"cgipat=cgi-bin/**\n");
-    WEB_INFO("cmd_buf=>%s",cmd_buf);
-    fprintf(fp,cmd_buf);
-
-    //chroot
-    snprintf(cmd_buf,sizeof(cmd_buf),"chroot\n");
-    WEB_INFO("cmd_buf=>%s",cmd_buf);
-    fprintf(fp,cmd_buf);
-
-    //user=root
-    snprintf(cmd_buf,sizeof(cmd_buf),"user=root\n");
-    WEB_INFO("cmd_buf=>%s",cmd_buf);
-    fprintf(fp,cmd_buf);
-
-    //max_age=0
-    snprintf(cmd_buf,sizeof(cmd_buf),"max_age=0\n");
-    WEB_INFO("cmd_buf=>%s",cmd_buf);
-    fprintf(fp,cmd_buf);
-
-    //debug(forthground)
-    snprintf(cmd_buf,sizeof(cmd_buf),"debug\n");
-    WEB_INFO("cmd_buf=>%s",cmd_buf);
-    fprintf(fp,cmd_buf);
-
-    if(DID_HTTPS==dmn_ctrl->did)
-    {
-        //ssl
-        snprintf(cmd_buf,sizeof(cmd_buf),"ssl\n");
-        WEB_INFO("cmd_buf=>%s",cmd_buf);
-        fprintf(fp,cmd_buf);
-
-        //certfile=/etc/icos/ca/cert.pem(TBC)
-        snprintf(cmd_buf,sizeof(cmd_buf),"certfile=/etc/icos/ca/cert.pem\n");
-        WEB_INFO("cmd_buf=>%s",cmd_buf);
-        fprintf(fp,cmd_buf);
-    }
-
-end:
-    fflush(fp);
-    fclose(fp);
-
-    return ICOS_SUCCESS;
-}
-
-
 static int is_request_start(DAEMON_CTRL_T *dmn_ctrl)
 {
     sWebConfig   *cfg=&gWebCtrl.cfg;
@@ -690,13 +623,6 @@ static int is_request_start(DAEMON_CTRL_T *dmn_ctrl)
         return ICOS_FAILURE;
     }

-
-
-    if(ICOS_FAILURE==create_daemon_conf(dmn_ctrl))
-    {
-        WEB_INFO("[DMN]Fail to gen DID%d config.\n",dmn_ctrl->did);
-        return ICOS_FAILURE;
-    }
     return ICOS_SUCCESS;
 }

抓一下 刪除前的 log

1536808777[20180913 3:19:37] [notify_web:854]Recv bcast evt 14 before module init done.Ignore it.
1536808780[20180913 3:19:40] [notify_web:862]IN(E82|S44|D44)
1536808780[20180913 3:19:40] [notify_web:871]module init
1536808780[20180913 3:19:40] [web_init:793][DID0] Key file generated done.
1536808780[20180913 3:19:40] [web_init:793][DID1] Key file generated done.
1536808785[20180913 3:19:45] [notify_web:862]IN(E73|S60|D00)
1536808794[20180913 3:19:54] [notify_web:862]IN(E77|S87|D00)
1536808796[20180913 3:19:56] [notify_web:862]IN(E72|S00|D00)
1536808796[20180913 3:19:56] [notify_web:896]boot init done
1536808796[20180913 3:19:56] [web_dump:516]===init config===
1536808796[20180913 3:19:56] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
1536808796[20180913 3:19:56] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
1536808796[20180913 3:19:56] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
1536808796[20180913 3:19:56] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
1536808796[20180913 3:19:56] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
1536808796[20180913 3:19:56] [notify_web:1039]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=
1536808796[20180913 3:19:56] [daemon_restart:706][DID0] remain IP server retry for 6 times.
1536808796[20180913 3:19:56] [create_daemon_conf:605]IN
1536808796[20180913 3:19:56] [create_daemon_conf:616]cmd_buf=>dir=/
1536808796[20180913 3:19:56] [create_daemon_conf:621]cmd_buf=>cgipat=cgi-bin/**
1536808796[20180913 3:19:56] [create_daemon_conf:626]cmd_buf=>chroot
1536808796[20180913 3:19:56] [create_daemon_conf:631]cmd_buf=>user=root
1536808796[20180913 3:19:56] [create_daemon_conf:636]cmd_buf=>max_age=0
1536808796[20180913 3:19:56] [create_daemon_conf:641]cmd_buf=>debug
1536808796[20180913 3:19:56] [daemon_restart:748][DMN]Lanch=>/usr/sbin/iweb  -p 80 -d /www
1536808796[20180913 3:19:56] [notify_web:1039]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=
1536808796[20180913 3:19:56] [daemon_restart:706][DID1] remain IP server retry for 6 times.
1536808796[20180913 3:19:56] [gen_key_files:578]IN
1536808796[20180913 3:19:56] [gen_key_files:593]OUT
1536808796[20180913 3:19:56] [create_daemon_conf:605]IN
1536808796[20180913 3:19:56] [create_daemon_conf:616]cmd_buf=>dir=/
1536808796[20180913 3:19:56] [create_daemon_conf:621]cmd_buf=>cgipat=cgi-bin/**
1536808796[20180913 3:19:56] [create_daemon_conf:626]cmd_buf=>chroot
1536808796[20180913 3:19:56] [create_daemon_conf:631]cmd_buf=>user=root
1536808796[20180913 3:19:56] [create_daemon_conf:636]cmd_buf=>max_age=0
1536808796[20180913 3:19:56] [create_daemon_conf:641]cmd_buf=>debug
1536808796[20180913 3:19:56] [create_daemon_conf:648]cmd_buf=>ssl
1536808796[20180913 3:19:56] [create_daemon_conf:653]cmd_buf=>certfile=/etc/icos/ca/cert.pem
1536808796[20180913 3:19:56] [daemon_restart:748][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
1536808796[20180913 3:19:56] [web_dump:516]===After daemon restart===
1536808796[20180913 3:19:56] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
1536808796[20180913 3:19:56] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
1536808796[20180913 3:19:56] [web_dump:562][DMN0]active=1,pid=1691,status=1,flag=0x0,DID0
1536808796[20180913 3:19:56] [web_dump:562][DMN1]active=1,pid=1693,status=1,flag=0x0,DID1
1536808796[20180913 3:19:56] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
1536808798[20180913 3:19:58] [msgcb_web:1218]IN(DID1,pid 1693)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting SSL iweb on port 443, cert from /etc/icos/web/iweb_cert.pem, key from /etc/icos/web/iweb_key.pem, serving /www
-->
1536808798[20180913 3:19:58] [msgcb_web:1218]IN(DID0,pid 1691)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting iweb on port 80, serving /www
-->
1536808798[20180913 3:19:58] [notify_web:862]IN(E48|S41|D00)
1536808798[20180913 3:19:58] [notify_web:862]IN(E50|S59|D00)
1536808803[20180913 3:20:3] [notify_web:862]IN(E59|S59|D00)
1536808806[20180913 3:20:6] [notify_web:862]IN(E02|S56|D00)
1536808806[20180913 3:20:6] [notify_web:862]IN(E01|S56|D00)
1536808806[20180913 3:20:6] [notify_web:862]IN(E40|S35|D00)
1536808807[20180913 3:20:7] [notify_web:862]IN(E46|S35|D00)
1536808807[20180913 3:20:7] [notify_web:862]IN(E47|S35|D00)
1536808807[20180913 3:20:7] [notify_web:862]IN(E46|S35|D00)
1536808807[20180913 3:20:7] [notify_web:862]IN(E50|S59|D00)
1536808816[20180913 3:20:16] [notify_web:862]IN(E59|S59|D00)
1536808837[20180913 3:20:37] [notify_web:862]IN(E85|S67|D00)

刪除後

1536808929[20180913 3:22:9] [notify_web:780]Recv bcast evt 14 before module init done.Ignore it.
1536808932[20180913 3:22:12] [notify_web:788]IN(E82|S44|D44)
1536808932[20180913 3:22:12] [notify_web:797]module init
1536808932[20180913 3:22:12] [web_init:719][DID0] Key file generated done.
1536808932[20180913 3:22:12] [web_init:719][DID1] Key file generated done.
1536808937[20180913 3:22:17] [notify_web:788]IN(E73|S60|D00)
1536808946[20180913 3:22:26] [notify_web:788]IN(E77|S87|D00)
1536808948[20180913 3:22:28] [notify_web:788]IN(E72|S00|D00)
1536808948[20180913 3:22:28] [notify_web:822]boot init done
1536808948[20180913 3:22:28] [web_dump:516]===init config===
1536808948[20180913 3:22:28] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
1536808948[20180913 3:22:28] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
1536808948[20180913 3:22:28] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
1536808948[20180913 3:22:28] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
1536808948[20180913 3:22:28] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
1536808948[20180913 3:22:28] [notify_web:965]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=
1536808948[20180913 3:22:28] [daemon_restart:632][DID0] remain IP server retry for 6 times.
1536808948[20180913 3:22:28] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 80 -d /www
1536808948[20180913 3:22:28] [notify_web:965]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=
1536808948[20180913 3:22:28] [daemon_restart:632][DID1] remain IP server retry for 6 times.
1536808948[20180913 3:22:28] [gen_key_files:578]IN
1536808948[20180913 3:22:28] [gen_key_files:593]OUT
1536808948[20180913 3:22:28] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
1536808948[20180913 3:22:28] [web_dump:516]===After daemon restart===
1536808948[20180913 3:22:28] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
1536808948[20180913 3:22:28] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
1536808948[20180913 3:22:28] [web_dump:562][DMN0]active=1,pid=1673,status=1,flag=0x0,DID0
1536808948[20180913 3:22:28] [web_dump:562][DMN1]active=1,pid=1676,status=1,flag=0x0,DID1
1536808948[20180913 3:22:28] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
1536808950[20180913 3:22:30] [msgcb_web:1144]IN(DID1,pid 1676)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting SSL iweb on port 443, cert from /etc/icos/web/iweb_cert.pem, key from /etc/icos/web/iweb_key.pem, serving /www
-->
1536808950[20180913 3:22:30] [msgcb_web:1144]IN(DID0,pid 1673)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting iweb on port 80, serving /www
-->
1536808951[20180913 3:22:31] [notify_web:788]IN(E48|S41|D00)
1536808951[20180913 3:22:31] [notify_web:788]IN(E50|S59|D00)

HTTPD 和 HTTPS 都運作正常

root@Cellular Router:~# ps aux | grep iweb
root      1673  0.1  0.4  10572  2256 pts/4    Ss+  03:22   0:00 iweb -p 80 -d /www
root      1676  0.5  0.5  10572  2992 pts/5    Ss+  03:22   0:00 iweb -p 443 -d /www -s
root      5882  0.0  0.0   1768   320 ttymxc0  S+   03:23   0:00 grep iweb

改一下 IPC_filelog_v2 讓 log 的時間欄位更對齊

proscend/prosrc/icos/icoslib/ipc_utility/icos_ipc.c

@@ -138,7 +138,7 @@ void IPC_filelog_v2(const char *fname, long file_size, const char *funname, int
             struct tm tm = *localtime(&t);
             if(IPCFv2_SHOW_TIME==show_time)
             {
-                fprintf(fp,"%ld[%d%02d%02d %d:%d:%d] ", (long)t,
+                fprintf(fp,"%ld[%d%02d%02d %02d:%02d:%02d] ", (long)t,
                         tm.tm_year + 1900, tm.tm_mon + 1,
                         tm.tm_mday, tm.tm_hour,
                         tm.tm_min, tm.tm_sec);
@@ -149,7 +149,7 @@ void IPC_filelog_v2(const char *fname, long file_size, const char *funname, int
             }
             else if(IPCFv2_SHOW_TIME_2==show_time)
             {
-                fprintf(fp,"[%d%02d%02d %d:%d:%d] ",
+                fprintf(fp,"[%d%02d%02d %02d:%02d:%02d] ",
                         tm.tm_year + 1900, tm.tm_mon + 1,
                         tm.tm_mday, tm.tm_hour,
                         tm.tm_min, tm.tm_sec);

順眼多了

root@Cellular Router:~# cat /home/log/web.log
1536809320[20180913 03:28:40] [notify_web:780]Recv bcast evt 14 before module init done.Ignore it.
1536809323[20180913 03:28:43] [notify_web:788]IN(E82|S44|D44)
1536809323[20180913 03:28:43] [notify_web:797]module init
1536809323[20180913 03:28:43] [web_init:719][DID0] Key file generated done.
1536809323[20180913 03:28:43] [web_init:719][DID1] Key file generated done.
1536809328[20180913 03:28:48] [notify_web:788]IN(E73|S60|D00)
1536809337[20180913 03:28:57] [notify_web:788]IN(E77|S87|D00)
1536809339[20180913 03:28:59] [notify_web:788]IN(E72|S00|D00)
1536809339[20180913 03:28:59] [notify_web:822]boot init done
1536809339[20180913 03:28:59] [web_dump:516]===init config===
1536809339[20180913 03:28:59] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
1536809339[20180913 03:28:59] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
1536809339[20180913 03:28:59] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
1536809339[20180913 03:28:59] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
1536809339[20180913 03:28:59] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
1536809339[20180913 03:28:59] [notify_web:965]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=
1536809339[20180913 03:28:59] [daemon_restart:632][DID0] remain IP server retry for 6 times.
1536809339[20180913 03:28:59] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 80 -d /www
1536809339[20180913 03:28:59] [notify_web:965]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=
1536809339[20180913 03:28:59] [daemon_restart:632][DID1] remain IP server retry for 6 times.
1536809339[20180913 03:28:59] [gen_key_files:578]IN
1536809339[20180913 03:28:59] [gen_key_files:593]OUT
1536809339[20180913 03:28:59] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
1536809339[20180913 03:28:59] [web_dump:516]===After daemon restart===
1536809339[20180913 03:28:59] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
1536809339[20180913 03:28:59] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
1536809339[20180913 03:28:59] [web_dump:562][DMN0]active=1,pid=1659,status=1,flag=0x0,DID0
1536809339[20180913 03:28:59] [web_dump:562][DMN1]active=1,pid=1662,status=1,flag=0x0,DID1
1536809339[20180913 03:28:59] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
1536809341[20180913 03:29:01] [msgcb_web:1144]IN(DID1,pid 1662)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting SSL iweb on port 443, cert from /etc/icos/web/iweb_cert.pem, key from /etc/icos/web/iweb_key.pem, serving /www
-->
1536809341[20180913 03:29:01] [msgcb_web:1144]IN(DID0,pid 1659)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting iweb on port 80, serving /www
-->
1536809342[20180913 03:29:02] [notify_web:788]IN(E48|S41|D00)
1536809342[20180913 03:29:02] [notify_web:788]IN(E50|S59|D00)
1536809346[20180913 03:29:06] [notify_web:788]IN(E59|S59|D00)
1536809349[20180913 03:29:09] [notify_web:788]IN(E02|S56|D00)
1536809349[20180913 03:29:09] [notify_web:788]IN(E01|S56|D00)
1536809349[20180913 03:29:09] [notify_web:788]IN(E40|S35|D00)
1536809350[20180913 03:29:10] [notify_web:788]IN(E46|S35|D00)
1536809350[20180913 03:29:10] [notify_web:788]IN(E47|S35|D00)
1536809350[20180913 03:29:10] [notify_web:788]IN(E46|S35|D00)
1536809350[20180913 03:29:10] [notify_web:788]IN(E50|S59|D00)
1536809359[20180913 03:29:19] [notify_web:788]IN(E59|S59|D00)

再修一下 log 輸出的格式選擇

proscend/prosrc/icos/icoslib/web/webcfg.c

@@ -6,9 +6,9 @@

 //Logs
 #define WEB_LOG                   LOG_DIR"/web.log"
-#define WEB_DBG(FMT, ARG...)      IPC_filelog_v2(WEB_LOG,IPCF_LOGMAX, __FUNCTION__, __LINE__,IPCFv2_SHOW_TIME, FMT, ##ARG)
-#define WEB_INFO(FMT, ARG...)     IPC_filelog_v2(WEB_LOG,IPCF_LOGMAX, __FUNCTION__, __LINE__,IPCFv2_SHOW_TIME, FMT, ##ARG)
-#define WEB_ERR(FMT, ARG...)      IPC_filelog_v2(WEB_LOG,IPCF_LOGMAX, __FUNCTION__, __LINE__,IPCFv2_SHOW_TIME, FMT, ##ARG)
+#define WEB_DBG(FMT, ARG...)      IPC_filelog_v2(WEB_LOG,IPCF_LOGMAX, __FUNCTION__, __LINE__,IPCFv2_SHOW_TIME_2, FMT, ##ARG)
+#define WEB_INFO(FMT, ARG...)     IPC_filelog_v2(WEB_LOG,IPCF_LOGMAX, __FUNCTION__, __LINE__,IPCFv2_SHOW_TIME_2, FMT, ##ARG)
+#define WEB_ERR(FMT, ARG...)      IPC_filelog_v2(WEB_LOG,IPCF_LOGMAX, __FUNCTION__, __LINE__,IPCFv2_SHOW_TIME_2, FMT, ##ARG)
 #define WEB_DAEMON(FMT, ARG...)   IPC_filelog_v2(WEB_LOG,IPCF_LOGMAX,NULL,0,IPCFv2_SHOW_TIME_NONE,FMT,##ARG)

 #define WEB_ETC_DIR              ICOS_DIR"/web"

log 清爽多了

[20180913 03:33:12] [notify_web:780]Recv bcast evt 14 before module init done.Ignore it.
[20180913 03:33:15] [notify_web:788]IN(E82|S44|D44)
[20180913 03:33:15] [notify_web:797]module init
[20180913 03:33:15] [web_init:719][DID0] Key file generated done.
[20180913 03:33:15] [web_init:719][DID1] Key file generated done.
[20180913 03:33:20] [notify_web:788]IN(E73|S60|D00)
[20180913 03:33:29] [notify_web:788]IN(E77|S87|D00)
[20180913 03:33:31] [notify_web:788]IN(E72|S00|D00)
[20180913 03:33:31] [notify_web:822]boot init done
[20180913 03:33:31] [web_dump:516]===init config===
[20180913 03:33:31] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 03:33:31] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 03:33:31] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
[20180913 03:33:31] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 03:33:31] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 03:33:31] [notify_web:965]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=
[20180913 03:33:31] [daemon_restart:632][DID0] remain IP server retry for 6 times.
[20180913 03:33:31] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 80 -d /www
[20180913 03:33:31] [notify_web:965]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=
[20180913 03:33:31] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 03:33:31] [gen_key_files:578]IN
[20180913 03:33:31] [gen_key_files:593]OUT
[20180913 03:33:31] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
[20180913 03:33:32] [web_dump:516]===After daemon restart===
[20180913 03:33:32] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 03:33:32] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 03:33:32] [web_dump:562][DMN0]active=1,pid=1688,status=1,flag=0x0,DID0
[20180913 03:33:32] [web_dump:562][DMN1]active=1,pid=1690,status=1,flag=0x0,DID1
[20180913 03:33:32] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 03:33:34] [msgcb_web:1144]IN(DID1,pid 1690)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting SSL iweb on port 443, cert from /etc/icos/web/iweb_cert.pem, key from /etc/icos/web/iweb_key.pem, serving /www
-->
[20180913 03:33:34] [msgcb_web:1144]IN(DID0,pid 1688)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting iweb on port 80, serving /www
-->
[20180913 03:33:34] [notify_web:788]IN(E48|S41|D00)
[20180913 03:33:34] [notify_web:788]IN(E50|S59|D00)

上 code

commit 34d7de9da1aa2431c22625dfea7655a9631cb860
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Thu Sep 13 11:50:38 2018 +0800

    refactoring web module:
    - fine tune the log output format
    - remove unused create_daemon_conf()

 .../prosrc/icos/icoslib/ipc_utility/icos_ipc.c     | 52 +++++++-------
 proscend/prosrc/icos/icoslib/web/webcfg.c          | 80 +---------------------
 2 files changed, 29 insertions(+), 103 deletions(-)

1300

把 key 刪掉觀察一下 log

[20180913 04:47:41] [notify_web:780]Recv bcast evt 14 before module init done.Ignore it.
[20180913 04:47:44] [notify_web:788]IN(E82|S44|D44)
[20180913 04:47:44] [notify_web:797]module init
[20180913 04:47:49] [notify_web:788]IN(E73|S60|D00)
[20180913 04:47:56] [notify_web:788]IN(E77|S87|D00)
[20180913 04:48:01] [notify_web:788]IN(E72|S00|D00)
[20180913 04:48:01] [notify_web:822]boot init done
[20180913 04:48:01] [web_dump:516]===init config===
[20180913 04:48:01] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 04:48:01] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 04:48:01] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
[20180913 04:48:01] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 04:48:01] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 04:48:01] [notify_web:965]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=
[20180913 04:48:01] [daemon_restart:632][DID0] remain IP server retry for 6 times.
[20180913 04:48:01] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 80 -d /www
[20180913 04:48:01] [notify_web:965]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=
[20180913 04:48:01] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 04:48:01] [gen_key_files:578]IN
[20180913 04:48:01] [gen_key_files:590]iweb genkey pid = 1722
[20180913 04:48:01] [gen_key_files:593]OUT
[20180913 04:48:01] [is_request_start:621][DMN]disabled cause key not ready.
[20180913 04:48:01] [web_dump:562][DMN0]active=1,pid=1720,status=1,flag=0x0,DID0
[20180913 04:48:01] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x1,DID1
[20180913 04:48:01] [web_dump:516]===After daemon restart===
[20180913 04:48:01] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 04:48:01] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 04:48:01] [web_dump:562][DMN0]active=1,pid=1720,status=1,flag=0x0,DID0
[20180913 04:48:01] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 04:48:01] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 04:48:04] [msgcb_web:1144]IN(DID0,pid 1720)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting iweb on port 80, serving /www
-->
[20180913 04:48:05] [notify_web:788]IN(E48|S41|D00)
[20180913 04:48:05] [notify_web:788]IN(E50|S59|D00)
[20180913 04:48:11] [notify_web:788]IN(E59|S59|D00)
[20180913 04:48:15] [notify_web:788]IN(E02|S56|D00)
[20180913 04:48:15] [notify_web:788]IN(E01|S56|D00)
[20180913 04:48:15] [notify_web:788]IN(E40|S35|D00)
[20180913 04:48:16] [notify_web:788]IN(E46|S35|D00)
[20180913 04:48:16] [notify_web:788]IN(E47|S35|D00)
[20180913 04:48:16] [notify_web:788]IN(E46|S35|D00)
[20180913 04:48:17] [notify_web:788]IN(E50|S59|D00)
[20180913 04:48:28] [notify_web:788]IN(E59|S59|D00)
[20180913 04:48:38] [notify_web:788]IN(E85|S67|D00)
[20180913 04:48:50] [termcb_web:1008]IN(1722)
[20180913 04:48:50] [termcb_web:1056]HTTPS key and cert generated done.
[20180913 04:48:50] [web_dump:516]===Key file generated done, daemon restart===
[20180913 04:48:50] [web_dump:562][DMN0]active=1,pid=1720,status=1,flag=0x0,DID0
[20180913 04:48:50] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 04:48:50] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 04:48:50] [gen_key_files:578]IN
[20180913 04:48:50] [gen_key_files:593]OUT
[20180913 04:48:50] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
[20180913 04:48:50] [msgcb_web:1144]IN(DID1,pid 4687)
<--
failed to load the session from binary
-->
[20180913 04:48:51] [msgcb_web:1144]IN(DID1,pid 4687)
<--
Icos_users.session_ttl: 300 sec
-->
[20180913 04:48:51] [msgcb_web:1144]IN(DID1,pid 4687)
<--
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting SSL iweb on port 443, cert from /etc/icos/web/iweb_cert.pem, key from /etc/icos/web/iweb_key.pem, serving /www
-->

PASS

故意讓 key 失效

[20180913 04:50:17] [notify_web:780]Recv bcast evt 14 before module init done.Ignore it.
[20180913 04:50:20] [notify_web:788]IN(E82|S44|D44)
[20180913 04:50:20] [notify_web:797]module init
[20180913 04:50:20] [web_init:719][DID0] Key file generated done.
[20180913 04:50:20] [web_init:719][DID1] Key file generated done.
[20180913 04:50:27] [notify_web:788]IN(E73|S60|D00)
[20180913 04:50:37] [notify_web:788]IN(E77|S87|D00)
[20180913 04:50:41] [notify_web:788]IN(E72|S00|D00)
[20180913 04:50:41] [notify_web:822]boot init done
[20180913 04:50:41] [web_dump:516]===init config===
[20180913 04:50:41] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 04:50:41] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 04:50:41] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
[20180913 04:50:41] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 04:50:41] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 04:50:41] [notify_web:965]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=
[20180913 04:50:41] [daemon_restart:632][DID0] remain IP server retry for 6 times.
[20180913 04:50:41] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 80 -d /www
[20180913 04:50:41] [notify_web:965]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=
[20180913 04:50:41] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 04:50:41] [gen_key_files:578]IN
[20180913 04:50:41] [gen_key_files:593]OUT
[20180913 04:50:41] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
[20180913 04:50:41] [web_dump:516]===After daemon restart===
[20180913 04:50:41] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 04:50:41] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 04:50:41] [web_dump:562][DMN0]active=1,pid=1801,status=1,flag=0x0,DID0
[20180913 04:50:41] [web_dump:562][DMN1]active=1,pid=1803,status=1,flag=0x0,DID1
[20180913 04:50:41] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 04:50:43] [termcb_web:1008]IN(1803)
[20180913 04:50:43] [termcb_web:1033]HTTPS terminate, remove key and cert and restart the daemon
[20180913 04:50:43] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 04:50:43] [gen_key_files:578]IN
[20180913 04:50:43] [gen_key_files:590]iweb genkey pid = 1961
[20180913 04:50:43] [gen_key_files:593]OUT
[20180913 04:50:43] [is_request_start:621][DMN]disabled cause key not ready.
[20180913 04:50:43] [web_dump:562][DMN0]active=1,pid=1801,status=1,flag=0x0,DID0
[20180913 04:50:43] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 04:50:43] [web_dump:516]===Daemon killed restart===
[20180913 04:50:43] [web_dump:562][DMN0]active=1,pid=1801,status=1,flag=0x0,DID0
[20180913 04:50:43] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 04:50:43] [termcb_web:1067]HTTPS key and cert generated fail.
[20180913 04:50:44] [notify_web:788]IN(E48|S41|D00)
[20180913 04:50:44] [msgcb_web:1144]IN(DID0,pid 1801)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting iweb on port 80, serving /www
-->
[20180913 04:50:44] [notify_web:788]IN(E50|S59|D00)
[20180913 04:50:52] [notify_web:788]IN(E59|S59|D00)
[20180913 04:50:55] [notify_web:788]IN(E02|S56|D00)
[20180913 04:50:55] [notify_web:788]IN(E01|S56|D00)
[20180913 04:50:56] [notify_web:788]IN(E40|S35|D00)
[20180913 04:51:00] [notify_web:788]IN(E46|S35|D00)
[20180913 04:51:01] [notify_web:788]IN(E47|S35|D00)
[20180913 04:51:01] [notify_web:788]IN(E46|S35|D00)
[20180913 04:51:01] [notify_web:788]IN(E43|S35|D00)
[20180913 04:51:01] [notify_web:788]IN(E50|S59|D00)
[20180913 04:51:09] [termcb_web:1008]IN(1961)
[20180913 04:51:09] [termcb_web:1056]HTTPS key and cert generated done.
[20180913 04:51:09] [web_dump:516]===Key file generated done, daemon restart===
[20180913 04:51:09] [web_dump:562][DMN0]active=1,pid=1801,status=1,flag=0x0,DID0
[20180913 04:51:09] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 04:51:09] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 04:51:09] [gen_key_files:578]IN
[20180913 04:51:09] [gen_key_files:593]OUT
[20180913 04:51:09] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
[20180913 04:51:10] [msgcb_web:1144]IN(DID1,pid 3582)
<--
failed to load the session from binary
-->
[20180913 04:51:10] [msgcb_web:1144]IN(DID1,pid 3582)
<--
Icos_users.session_ttl: 300 sec
-->
[20180913 04:51:10] [msgcb_web:1144]IN(DID1,pid 3582)
<--
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting SSL iweb on port 443, cert from /etc/icos/web/iweb_cert.pem, key from /etc/icos/web/iweb_key.pem, serving /www
-->
[20180913 04:51:27] [notify_web:788]IN(E85|S67|D00)

從 log 出發再來整理一下

[20180913 04:50:44] [notify_web:788]IN(E50|S59|D00)
[20180913 04:50:52] [notify_web:788]IN(E59|S59|D00)
[20180913 04:50:55] [notify_web:788]IN(E02|S56|D00)
[20180913 04:50:55] [notify_web:788]IN(E01|S56|D00)
[20180913 04:50:56] [notify_web:788]IN(E40|S35|D00)
[20180913 04:51:00] [notify_web:788]IN(E46|S35|D00)
[20180913 04:51:01] [notify_web:788]IN(E47|S35|D00)
[20180913 04:51:01] [notify_web:788]IN(E46|S35|D00)
[20180913 04:51:01] [notify_web:788]IN(E43|S35|D00)
[20180913 04:51:01] [notify_web:788]IN(E50|S59|D00)

這種不相干的 event 就不要打印了

    if(NULL==pevent)
    {
        WEB_ERR("Null event.\n");
        return ICOS_SUCCESS;
    }
    if(0==pevent->dst_id && 0==gWebCtrl.mod_init_done)
    {
        WEB_INFO("Recv bcast evt %d before module init done.Ignore it.\n",pevent->event_id);
        return ICOS_SUCCESS;
    }
    if(MODULE_WEB!=pevent->dst_id && 0!=pevent->dst_id)
    {
        WEB_INFO("Recv for %d module evt id %d.Ignore it.\n",pevent->dst_id);
        return ICOS_SUCCESS;
    }

不過防範異常的打印還是要的

每個需要處理的 event 都把 event name 打印出來

diff --git a/proscend/prosrc/icos/icoslib/web/webcfg.c b/proscend/prosrc/icos/icoslib/web/webcfg.c
index 9f7f8f3..72394ea 100644
--- a/proscend/prosrc/icos/icoslib/web/webcfg.c
+++ b/proscend/prosrc/icos/icoslib/web/webcfg.c
@@ -785,11 +785,11 @@ static int notify_web(PRO_EVENT *pevent)
         WEB_INFO("Recv for %d module evt id %d.Ignore it.\n",pevent->dst_id);
         return ICOS_SUCCESS;
     }
-    WEB_INFO("IN(E%02d|S%02d|D%02d)\n",pevent->event_id,pevent->src_id,pevent->dst_id);

     switch(pevent->event_id)
     {
         case ICOS_UCAST_MODULE_APPLY:
+            WEB_INFO("ICOS_UCAST_MODULE_APPLY\n");
             if(pevent->msg_len==sizeof(sWebConfig))
             {
                 if(0==gWebCtrl.mod_init_done)
@@ -811,6 +811,7 @@ static int notify_web(PRO_EVENT *pevent)
             break;

         case ICOS_UCAST_MODULE_EXIT:
+            WEB_INFO("ICOS_UCAST_MODULE_EXIT\n");
             if(MODULE_WEB==pevent->dst_id)
             {
                 WEB_INFO("module exit\n");
@@ -819,7 +820,7 @@ static int notify_web(PRO_EVENT *pevent)
             break;

         case ICOS_BOOTINIT_DONE:
-            WEB_INFO("boot init done\n");
+            WEB_INFO("ICOS_BOOTINIT_DONE\n");
             web_dump(DUMP_ALL,"init config");
             for(i=0; MAX_DAEMON_NUM>i; i++)
             {
@@ -828,7 +829,9 @@ static int notify_web(PRO_EVENT *pevent)
             break;

         case ICOS_WAN_GATEWAY_UPDATE:
+            WEB_INFO("ICOS_WAN_GATEWAY_UPDATE\n");
         case ICOS_WAN_IP_UPDATE:
+            WEB_INFO("ICOS_WAN_IP_UPDATE\n");
             if(pevent->msg_len==sizeof(PROTO4INFO_T))
             {
                 PROTO4INFO_T *wan_info=(PROTO4INFO_T *)pevent->msg;
@@ -854,7 +857,9 @@ static int notify_web(PRO_EVENT *pevent)
             break;

         case ICOS_WAN6_GATEWAY_UPDATE:
+            WEB_INFO("ICOS_WAN6_GATEWAY_UPDATE\n");
         case ICOS_WAN6_IP_UPDATE:
+            WEB_INFO("ICOS_WAN6_IP_UPDATE\n");
             if(pevent->msg_len==sizeof(PROTO6INFO_T))
             {
                 PROTO6INFO_T *wan_info = (PROTO6INFO_T *)pevent->msg;
@@ -880,6 +885,7 @@ static int notify_web(PRO_EVENT *pevent)
             break;

         case ICOS_WAN_LOST_CONNECTION:
+            WEB_INFO("ICOS_WAN_LOST_CONNECTION\n");
             if(0<pevent->msg_len)
             {
                 WEB_DBG("WAN4 Lost<%s>\n",pevent->msg);
@@ -897,6 +903,7 @@ static int notify_web(PRO_EVENT *pevent)
             }
             break;
         case ICOS_WAN6_LOST_CONNECTION:
+            WEB_INFO("ICOS_WAN6_LOST_CONNECTION\n");
             if(0<pevent->msg_len)
             {
                 WEB_DBG("WAN6 Lost<%s>\n",pevent->msg);
@@ -915,7 +922,9 @@ static int notify_web(PRO_EVENT *pevent)
             break;

         case ICOS_SYSTEM_UPDATE:
+            WEB_INFO("ICOS_SYSTEM_UPDATE\n");
         case ICOS_UCAST_DMN_RESTART:
+            WEB_INFO("ICOS_UCAST_DMN_RESTART\n");
             WEB_INFO("daemon restart\n");
             web_dump(DUMP_ALL,"init config");
             for(i=0; MAX_DAEMON_NUM>i; i++)

插上 SIM 卡觀察一下

[20180913 05:34:14] [notify_web:780]Recv bcast evt 14 before module init done.Ignore it.
[20180913 05:34:17] [notify_web:792]ICOS_UCAST_MODULE_APPLY
[20180913 05:34:17] [notify_web:797]module init
[20180913 05:34:35] [notify_web:823]ICOS_BOOTINIT_DONE
[20180913 05:34:35] [web_dump:516]===init config===
[20180913 05:34:35] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 05:34:35] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 05:34:35] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
[20180913 05:34:35] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 05:34:35] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 05:34:35] [notify_web:974]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=
[20180913 05:34:35] [daemon_restart:632][DID0] remain IP server retry for 6 times.
[20180913 05:34:35] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 80 -d /www
[20180913 05:34:35] [notify_web:974]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=
[20180913 05:34:35] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 05:34:35] [gen_key_files:578]IN
[20180913 05:34:35] [gen_key_files:590]iweb genkey pid = 2162
[20180913 05:34:35] [gen_key_files:593]OUT
[20180913 05:34:35] [is_request_start:621][DMN]disabled cause key not ready.
[20180913 05:34:35] [web_dump:562][DMN0]active=1,pid=2160,status=1,flag=0x0,DID0
[20180913 05:34:35] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x1,DID1
[20180913 05:34:35] [web_dump:516]===After daemon restart===
[20180913 05:34:35] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 05:34:35] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 05:34:35] [web_dump:562][DMN0]active=1,pid=2160,status=1,flag=0x0,DID0
[20180913 05:34:35] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 05:34:35] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 05:34:38] [msgcb_web:1153]IN(DID0,pid 2160)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting iweb on port 80, serving /www
-->
[20180913 05:35:16] [termcb_web:1017]IN(2162)
[20180913 05:35:16] [termcb_web:1065]HTTPS key and cert generated done.
[20180913 05:35:16] [web_dump:516]===Key file generated done, daemon restart===
[20180913 05:35:16] [web_dump:562][DMN0]active=1,pid=2160,status=1,flag=0x0,DID0
[20180913 05:35:16] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 05:35:16] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 05:35:16] [gen_key_files:578]IN
[20180913 05:35:16] [gen_key_files:593]OUT
[20180913 05:35:16] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
[20180913 05:35:16] [msgcb_web:1153]IN(DID1,pid 4105)
<--
failed to load the session from binary
-->
[20180913 05:35:20] [msgcb_web:1153]IN(DID1,pid 4105)
<--
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting SSL iweb on port 443, cert from /etc/icos/web/iweb_cert.pem, key from /etc/icos/web/iweb_key.pem, serving /www
-->
[20180913 05:36:04] [notify_web:834]ICOS_WAN_IP_UPDATE
[20180913 05:36:04] [notify_web:841]Ignore due to conn_mgr is on.
[20180913 05:36:05] [notify_web:832]ICOS_WAN_GATEWAY_UPDATE
[20180913 05:36:05] [notify_web:834]ICOS_WAN_IP_UPDATE
[20180913 05:36:05] [notify_web:844]WAN IP UPDATE
[20180913 05:36:05] [notify_web:974]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=eth2
[20180913 05:36:05] [notify_web:974]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=eth2
[20180913 05:36:11] [notify_web:862]ICOS_WAN6_IP_UPDATE
[20180913 05:36:11] [notify_web:869]Ignore due to conn_mgr is on.
[20180913 05:36:11] [notify_web:860]ICOS_WAN6_GATEWAY_UPDATE
[20180913 05:36:11] [notify_web:862]ICOS_WAN6_IP_UPDATE
[20180913 05:36:11] [notify_web:872]WAN6 IP UPDATE

commit 但先不 push

commit e143a6213bf5a918ff0c77b89c4b28d9679132c0
Refs: [develop]
Author: jeffrey <[email protected]>
Date:   Thu Sep 13 14:03:25 2018 +0800

    refactoring web module:
    - fine tune the debug output

 proscend/prosrc/icos/icoslib/web/webcfg.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

1405

debug log 裡

[20180913 05:34:38] [msgcb_web:1153]IN(DID0,pid 2160)
<--
failed to load the session from binary
Icos_users.session_ttl: 300 sec
Icos_users.users[0].name: root
Icos_users.users[0].pass: $1$$2Dg0uARUa9gcTJ9I5/iKb/
Icos_users.users[0].level: 3
Icos_users.users[1].name:
Icos_users.users[1].pass:
Icos_users.users[1].level: 0
Icos_users.users[2].name:
Icos_users.users[2].pass:
Icos_users.users[2].level: 0
Icos_users.users[3].name:
Icos_users.users[3].pass:
Icos_users.users[3].level: 0
Starting iweb on port 80, serving /www
-->

太囉嗦了

這是 iweb 的 _icos_users_init() 打印的

static void _icos_users_init()
{
    sSystemConfig icos_system;
    int res = ICOS_GetSetting(MODULE_SYSTEM, 0, 0, &icos_system, sizeof(icos_system));
    if (res != ICOS_SUCCESS)
    {
        printf("ICOS_GetSetting(MODULE_SYSTEM) fail\n");
        return 0;
    }

    Icos_users.session_ttl = icos_system.szTimeout;
    for (int i = 0; i < SYSTEM_USER_NUM; i ++)
    {
        strncpy(Icos_users.users[i].name, icos_system.user[i].szUsername, SYS_USERNAME_SIZE);
        strncpy(Icos_users.users[i].pass, icos_system.user[i].szPassword, SYS_USERNAME_SIZE);
        Icos_users.users[i].level = icos_system.user[i].userLevel;
    }

    printf("Icos_users.session_ttl: %d sec\n", Icos_users.session_ttl);
    for (int i = 0; i < SYSTEM_USER_NUM; i ++)
    {
        printf("Icos_users.users[%d].name: %s\n", i, Icos_users.users[i].name);
        printf("Icos_users.users[%d].pass: %s\n", i, Icos_users.users[i].pass);
        printf("Icos_users.users[%d].level: %d\n", i, Icos_users.users[i].level);
    }

}

刪掉這些 implement 階段打印的訊息吧

#if 0... #endif 包起來留著備用

@@ -1506,6 +1506,7 @@ static void _icos_users_init()
         Icos_users.users[i].level = icos_system.user[i].userLevel;
     }

+#if 0 // debug
     printf("Icos_users.session_ttl: %d sec\n", Icos_users.session_ttl);
     for (int i = 0; i < SYSTEM_USER_NUM; i ++)
     {
@@ -1513,6 +1514,7 @@ static void _icos_users_init()
         printf("Icos_users.users[%d].pass: %s\n", i, Icos_users.users[i].pass);
         printf("Icos_users.users[%d].level: %d\n", i, Icos_users.users[i].level);
     }
+#endif

 }

log 如下

[20180913 06:13:09] [msgcb_web:1153]IN(DID1,pid 1650)
<--
failed to load the session from binary
Starting SSL iweb on port 443, cert from /etc/icos/web/iweb_cert.pem, key from /etc/icos/web/iweb_key.pem, serving /www
-->
[20180913 06:13:09] [msgcb_web:1153]IN(DID0,pid 1648)
<--
failed to load the session from binary
Starting iweb on port 80, serving /www
-->

failed to load the session from binary 這字眼也拿掉

成功啟動的字眼也簡化一下

@@ -1600,13 +1601,11 @@ int main(int argc, char *argv[])

     if (start_ssl)
     {
-        printf("Starting SSL iweb on port %s, cert from %s, key from %s, serving %s\n",
-               s_http_port, bind_opts.ssl_cert, bind_opts.ssl_key, s_http_server_opts.document_root);
+        printf("Starting HTTPS on port %s, serving %s\n", s_http_port, s_http_server_opts.document_root);
     }
     else
     {
-        printf("Starting iweb on port %s, serving %s\n",
-               s_http_port, s_http_server_opts.document_root);
+        printf("Starting HTTP on port %s, serving %s\n", s_http_port, s_http_server_opts.document_root);
     }

     mg_set_timer(nc, mg_time() + SESSION_CHECK_INTERVAL);

在 key 已經存在的情況下 的 log

[20180913 06:27:28] [notify_web:780]Recv bcast evt 14 before module init done.Ignore it.
[20180913 06:27:31] [notify_web:792]ICOS_UCAST_MODULE_APPLY
[20180913 06:27:31] [notify_web:797]module init
[20180913 06:27:31] [web_init:719][DID0] Key file generated done.
[20180913 06:27:31] [web_init:719][DID1] Key file generated done.
[20180913 06:27:47] [notify_web:823]ICOS_BOOTINIT_DONE
[20180913 06:27:47] [web_dump:516]===init config===
[20180913 06:27:47] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 06:27:47] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 06:27:47] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
[20180913 06:27:47] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 06:27:47] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 06:27:47] [notify_web:974]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=
[20180913 06:27:47] [daemon_restart:632][DID0] remain IP server retry for 6 times.
[20180913 06:27:47] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 80 -d /www
[20180913 06:27:47] [notify_web:974]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=
[20180913 06:27:47] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 06:27:47] [gen_key_files:578]IN
[20180913 06:27:47] [gen_key_files:593]OUT
[20180913 06:27:47] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
[20180913 06:27:47] [web_dump:516]===After daemon restart===
[20180913 06:27:47] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 06:27:47] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 06:27:47] [web_dump:562][DMN0]active=1,pid=1676,status=1,flag=0x0,DID0
[20180913 06:27:47] [web_dump:562][DMN1]active=1,pid=1680,status=1,flag=0x0,DID1
[20180913 06:27:47] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 06:27:49] [msgcb_web:1153]IN(DID1,pid 1680)
<--
Starting HTTPS on port 443, serving /www
-->
[20180913 06:27:49] [msgcb_web:1153]IN(DID0,pid 1676)
<--
Starting HTTP on port 80, serving /www
-->

在 key 還不存在的情況下 的 log

[20180913 06:29:17] [notify_web:780]Recv bcast evt 14 before module init done.Ignore it.
[20180913 06:29:20] [notify_web:792]ICOS_UCAST_MODULE_APPLY
[20180913 06:29:20] [notify_web:797]module init
[20180913 06:29:36] [notify_web:823]ICOS_BOOTINIT_DONE
[20180913 06:29:36] [web_dump:516]===init config===
[20180913 06:29:36] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 06:29:36] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 06:29:36] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
[20180913 06:29:36] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 06:29:36] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 06:29:36] [notify_web:974]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=
[20180913 06:29:36] [daemon_restart:632][DID0] remain IP server retry for 6 times.
[20180913 06:29:36] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 80 -d /www
[20180913 06:29:36] [notify_web:974]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=
[20180913 06:29:36] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 06:29:36] [gen_key_files:578]IN
[20180913 06:29:36] [gen_key_files:590]iweb genkey pid = 1665
[20180913 06:29:36] [gen_key_files:593]OUT
[20180913 06:29:36] [is_request_start:621][DMN]disabled cause key not ready.
[20180913 06:29:36] [web_dump:562][DMN0]active=1,pid=1662,status=1,flag=0x0,DID0
[20180913 06:29:36] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x1,DID1
[20180913 06:29:36] [web_dump:516]===After daemon restart===
[20180913 06:29:36] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 06:29:36] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 06:29:36] [web_dump:562][DMN0]active=1,pid=1662,status=1,flag=0x0,DID0
[20180913 06:29:36] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 06:29:36] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 06:29:39] [msgcb_web:1153]IN(DID0,pid 1662)
<--
Starting HTTP on port 80, serving /www
-->
[20180913 06:29:59] [termcb_web:1017]IN(1665)
[20180913 06:29:59] [termcb_web:1065]HTTPS key and cert generated done.
[20180913 06:29:59] [web_dump:516]===Key file generated done, daemon restart===
[20180913 06:29:59] [web_dump:562][DMN0]active=1,pid=1662,status=1,flag=0x0,DID0
[20180913 06:29:59] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 06:29:59] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 06:29:59] [gen_key_files:578]IN
[20180913 06:29:59] [gen_key_files:593]OUT
[20180913 06:29:59] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
[20180913 06:30:04] [msgcb_web:1153]IN(DID1,pid 3027)
<--
Starting HTTPS on port 443, serving /www
-->

在 key 失效的 log

[20180913 06:34:39] [notify_web:780]Recv bcast evt 14 before module init done.Ignore it.
[20180913 06:34:42] [notify_web:792]ICOS_UCAST_MODULE_APPLY
[20180913 06:34:42] [notify_web:797]module init
[20180913 06:34:42] [web_init:719][DID0] Key file generated done.
[20180913 06:34:42] [web_init:719][DID1] Key file generated done.
[20180913 06:34:58] [notify_web:823]ICOS_BOOTINIT_DONE
[20180913 06:34:58] [web_dump:516]===init config===
[20180913 06:34:58] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 06:34:58] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 06:34:58] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
[20180913 06:34:58] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 06:34:58] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 06:34:58] [notify_web:974]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=
[20180913 06:34:58] [daemon_restart:632][DID0] remain IP server retry for 6 times.
[20180913 06:34:58] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 80 -d /www
[20180913 06:34:58] [notify_web:974]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=
[20180913 06:34:58] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 06:34:58] [gen_key_files:578]IN
[20180913 06:34:58] [gen_key_files:593]OUT
[20180913 06:34:58] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
[20180913 06:34:58] [web_dump:516]===After daemon restart===
[20180913 06:34:58] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 06:34:58] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 06:34:58] [web_dump:562][DMN0]active=1,pid=1665,status=1,flag=0x0,DID0
[20180913 06:34:58] [web_dump:562][DMN1]active=1,pid=1668,status=1,flag=0x0,DID1
[20180913 06:34:58] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 06:35:01] [termcb_web:1017]IN(1668)
[20180913 06:35:01] [termcb_web:1042]HTTPS terminate, remove key and cert and restart the daemon
[20180913 06:35:01] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 06:35:01] [gen_key_files:578]IN
[20180913 06:35:01] [gen_key_files:590]iweb genkey pid = 1809
[20180913 06:35:01] [gen_key_files:593]OUT
[20180913 06:35:01] [is_request_start:621][DMN]disabled cause key not ready.
[20180913 06:35:01] [web_dump:562][DMN0]active=1,pid=1665,status=1,flag=0x0,DID0
[20180913 06:35:01] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 06:35:01] [web_dump:516]===Daemon killed restart===
[20180913 06:35:01] [web_dump:562][DMN0]active=1,pid=1665,status=1,flag=0x0,DID0
[20180913 06:35:01] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 06:35:01] [termcb_web:1076]HTTPS key and cert generated fail.
[20180913 06:35:01] [msgcb_web:1153]IN(DID0,pid 1665)
<--
Starting HTTP on port 80, serving /www
-->
[20180913 06:35:06] [termcb_web:1017]IN(1809)
[20180913 06:35:06] [termcb_web:1065]HTTPS key and cert generated done.
[20180913 06:35:06] [web_dump:516]===Key file generated done, daemon restart===
[20180913 06:35:06] [web_dump:562][DMN0]active=1,pid=1665,status=1,flag=0x0,DID0
[20180913 06:35:06] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 06:35:06] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 06:35:06] [gen_key_files:578]IN
[20180913 06:35:06] [gen_key_files:593]OUT
[20180913 06:35:06] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
[20180913 06:35:10] [msgcb_web:1153]IN(DID1,pid 2196)
<--
Starting HTTPS on port 443, serving /www
-->

上 code 吧

commit e4a745e295b2f33747dc6c72c116b4c313e499fb
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Thu Sep 13 14:39:17 2018 +0800

    refactoring web module:
    - fine tune the debug output of iweb

 proscend/prosrc/icos/iweb/iweb.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

1500

function name 改俐落一點

再針對 ICOS_UCAST_MODULE_APPLY 這 event 相關的流程的處理 function 改一下 name

@@ -688,7 +688,7 @@ static void daemon_restart(DAEMON_CTRL_T *dmn_ctrl)
     }
 }

-static int web_init(sWebConfig *cfgp)
+static int controller_init(sWebConfig *cfgp)
 {
     int i;
     struct stat  st;
@@ -744,7 +744,7 @@ static void web_deinit(void)
     }
 }

-static void web_change(sWebConfig *new_cfg)
+static void _apply_config(sWebConfig *new_cfg)
 {
     int i;

@@ -764,7 +764,7 @@ static int period_sntp(void)
        return ICOS_SUCCESS;
 }*/

-static int notify_web(PRO_EVENT *pevent)
+static int _notify(PRO_EVENT *pevent)
 {
     int i;
     sWebConfig   *cfg=&gWebCtrl.cfg;
@@ -790,22 +790,22 @@ static int notify_web(PRO_EVENT *pevent)
     {
         case ICOS_UCAST_MODULE_APPLY:
             WEB_INFO("ICOS_UCAST_MODULE_APPLY\n");
-            if(pevent->msg_len==sizeof(sWebConfig))
+            if(pevent->msg_len != sizeof(sWebConfig))
             {
-                if(0==gWebCtrl.mod_init_done)
-                {
-                    WEB_INFO("module init\n");
-                    web_init((sWebConfig *)pevent->msg);
-                    gWebCtrl.mod_init_done=1;
-                }
-                else
+                break;
+            }
+
+            if(0 == gWebCtrl.mod_init_done)
+            {
+                controller_init((sWebConfig *)pevent->msg);
+                gWebCtrl.mod_init_done = 1;
+            }
+            else
+            {
+                if(memcmp(cfg, pevent->msg, sizeof(sWebConfig)))
                 {
-                    if(memcmp(cfg,pevent->msg,sizeof(sWebConfig)))
-                    {
-                        WEB_INFO("USER APPLY\n");
-                        web_dump(DUMP_CFG,"Before user apply");
-                        web_change((sWebConfig *)pevent->msg);
-                    }
+                    web_dump(DUMP_CFG,"Before user apply");
+                    _apply_config((sWebConfig *)pevent->msg);
                 }
             }
             break;
@@ -1010,7 +1010,7 @@ static int notify_web(PRO_EVENT *pevent)
     return ICOS_SUCCESS;
 }

-static int termcb_web(char *msg, pid_t pid)
+static int _termcb(char *msg, pid_t pid)
 {
     int i;

@@ -1141,7 +1141,7 @@ static void daemon_event(DAEMON_CTRL_T *dmn_ctrl,char *msg)
 }
 */

-static int msgcb_web(char *msg, pid_t pid, int rc)
+static int _msgcb(char *msg, pid_t pid, int rc)
 {
     int i;
     DAEMON_CTRL_T *dmn_ctrl=NULL;
@@ -1183,7 +1183,7 @@ sIcosModule webModule=
     .SetSetting    = SetWebSetting,
     .VerifySetting = VerifyWebSetting,
     .Factory       = facotry_default_web_setting,
-    .NotifyHandler = notify_web,
-    .proc_msg_cb   = msgcb_web,
-    .proc_term_cb  = termcb_web,
+    .NotifyHandler = _notify,
+    .proc_msg_cb   = _msgcb,
+    .proc_term_cb  = _termcb,
 };
[20180913 07:28:20] [_notify:780]Recv bcast evt 14 before module init done.Ignore it.
[20180913 07:28:23] [_notify:792]ICOS_UCAST_MODULE_APPLY
[20180913 07:28:23] [controller_init:719][DID0] Key file generated done.
[20180913 07:28:23] [controller_init:719][DID1] Key file generated done.
[20180913 07:28:43] [_notify:823]ICOS_BOOTINIT_DONE
[20180913 07:28:43] [web_dump:516]===init config===
[20180913 07:28:43] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 07:28:43] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 07:28:43] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
[20180913 07:28:43] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 07:28:43] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 07:28:43] [_notify:974]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=
[20180913 07:28:43] [daemon_restart:632][DID0] remain IP server retry for 6 times.
[20180913 07:28:43] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 80 -d /www
[20180913 07:28:43] [_notify:974]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=
[20180913 07:28:43] [daemon_restart:632][DID1] remain IP server retry for 6 times.
[20180913 07:28:43] [gen_key_files:578]IN
[20180913 07:28:43] [gen_key_files:593]OUT
[20180913 07:28:43] [daemon_restart:674][DMN]Lanch=>/usr/sbin/iweb  -p 443 -d /www -s
[20180913 07:28:43] [web_dump:516]===After daemon restart===
[20180913 07:28:43] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 07:28:43] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 07:28:43] [web_dump:562][DMN0]active=1,pid=1803,status=1,flag=0x0,DID0
[20180913 07:28:43] [web_dump:562][DMN1]active=1,pid=1804,status=1,flag=0x0,DID1
[20180913 07:28:43] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.
[20180913 07:28:46] [_msgcb:1153]IN(DID1,pid 1804)
<--
Starting HTTPS on port 443, serving /www
-->
[20180913 07:28:47] [_msgcb:1153]IN(DID0,pid 1803)
<--
Starting HTTP on port 80, serving /www
-->
[20180913 07:30:29] [_notify:834]ICOS_WAN_IP_UPDATE
[20180913 07:30:29] [_notify:841]Ignore due to conn_mgr is on.
[20180913 07:30:30] [_notify:832]ICOS_WAN_GATEWAY_UPDATE
[20180913 07:30:30] [_notify:834]ICOS_WAN_IP_UPDATE
[20180913 07:30:30] [_notify:844]WAN IP UPDATE
[20180913 07:30:30] [_notify:974]ipt_mgmt_rule_set[4]: iface_sel=3, wan4_ifname=eth2
[20180913 07:30:30] [_notify:974]ipt_mgmt_rule_set[4]: iface_sel=1, wan4_ifname=eth2
[20180913 07:30:37] [_notify:862]ICOS_WAN6_IP_UPDATE
[20180913 07:30:37] [_notify:869]Ignore due to conn_mgr is on.
[20180913 07:30:39] [_notify:860]ICOS_WAN6_GATEWAY_UPDATE
[20180913 07:30:39] [_notify:862]ICOS_WAN6_IP_UPDATE
[20180913 07:30:39] [_notify:872]WAN6 IP UPDATE

commit

commit 3be5735be1f3ded3491ef1f76bacef9b0fd3d947
Refs: [develop]
Author: jeffrey <[email protected]>
Date:   Thu Sep 13 15:33:46 2018 +0800

    refactoring web module:
    - rename notify_web() to _notify()
    - rename msgcb_web() to _msgcb()
    - rename termcb_web() to _termcb()
    - rename web_init() to controller_init()
    - rename web_change() to _apply_config()

 proscend/prosrc/icos/icoslib/web/webcfg.c | 44 +++++++++++++++----------------
 1 file changed, 22 insertions(+), 22 deletions(-)

1540

針對以下的流程繼續重構

[20180913 07:28:43] [_notify:823]ICOS_BOOTINIT_DONE
[20180913 07:28:43] [web_dump:516]===init config===
[20180913 07:28:43] [web_dump:526][COM]conn_mgr=1,mod_init_done:1.
[20180913 07:28:43] [web_dump:554][CFG]mode=both,httpd_port=80,https_port=443,refreshperiod=2,sport=80,intf=lan,secure=all,clienip=0.0.0.0,httpd_access=lan,https_access=lan
[20180913 07:28:43] [web_dump:562][DMN0]active=1,pid=-1,status=0,flag=0x0,DID0
[20180913 07:28:43] [web_dump:562][DMN1]active=1,pid=-1,status=0,flag=0x0,DID1
[20180913 07:28:43] [web_dump:567][RTI]wan4_ifname=,wan6_ifname=.

先暫緩

切回 M360 再 review 一下

1640

讓 PROSCEND 的 logo 顯眼一點

proscend/prosrc/www/brand_proscend/brand/custom.css

@@ -17,7 +17,7 @@ body {

 .navbar-custom .navbar-brand {
   height: 50px;
-  padding: 6px 12px 6px 12px;
+  padding: 4px 4px 2px 8px;^M
 }
 .navbar-custom .navbar-brand > img {
   height: 100%;

before

image

after

image

上 code

commit db0998f9c74f38fb22062c60ed04a911f27e0dcd
Refs: [release/v0.07], {origin/release/v0.07}
Author: jeffrey <[email protected]>
Date:   Thu Sep 13 16:43:23 2018 +0800

    let the PROSCEND logo more bigger in the banner bar

 proscend/prosrc/www/brand_proscend/brand/custom.css | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

1705

調整一下 LTE / Engineer 的顯示方式

拿掉 resolve 不然 page 會被該 resolve 影響

diff --git a/proscend/prosrc/www/app/feature/engineer.html b/proscend/prosrc/www/app/feature/engineer.html
index ed9af5a..ce49940 100644
--- a/proscend/prosrc/www/app/feature/engineer.html
+++ b/proscend/prosrc/www/app/feature/engineer.html
@@ -29,11 +29,13 @@
   </ul>
   <br /><br />

+  <p ng-show="vm.serving_cell_refreshing"><i class="fa fa-spinner fa-pulse fa-fw"></i></p>^M
+^M
   <div class="tab-content">

     <div id="serving_cell" class="tab-pane fade in active">

-      <table class="table table-striped table-condensed">
+      <table class="table table-striped table-condensed" ng-show="!vm.serving_cell_refreshing">^M
       <thead>
       <tr>
         <th>{{ 'ENGINEER_TH_ATTR' | translate }}</th>
diff --git a/proscend/prosrc/www/app/feature/engineer.js b/proscend/prosrc/www/app/feature/engineer.js
index 40005eb..864a092 100644
--- a/proscend/prosrc/www/app/feature/engineer.js
+++ b/proscend/prosrc/www/app/feature/engineer.js
@@ -14,13 +14,6 @@
         templateUrl:  'app/feature/engineer.html',
         controller: 'engineerController',
         controllerAs: 'vm',
-        resolve: {
-          query_eng: function(icos) {
-            return icos.lte.query_eng().then(function(result) {
-              return result.data.query_eng;
-            });
-          },
-        }
       })
   }

上 code

commit f9fb45233751f2b93eff45a591751ef94e9449e8
Refs: [release/v0.07], {origin/release/v0.07}
Author: jeffrey <[email protected]>
Date:   Thu Sep 13 17:07:04 2018 +0800

    remove the 'resolve' and add the refreshing indicator at 'LTE / Engineer' web page:
    - the resolve here take some times, so we display the page first then use refreshing indicator

 proscend/prosrc/www/app/feature/engineer.html | 4 +++-
 proscend/prosrc/www/app/feature/engineer.js   | 7 -------
 2 files changed, 3 insertions(+), 8 deletions(-)
⚠️ **GitHub.com Fallback** ⚠️