Browse Source

版本发布,打个标签

guohui 1 year ago
parent
commit
a97522591f
3 changed files with 16 additions and 45 deletions
  1. 8 37
      pro/config/cfg.h
  2. 1 2
      pro/src/app.c
  3. 7 6
      pro/src/appweb_handle.c

+ 8 - 37
pro/config/cfg.h

@@ -24,6 +24,13 @@
 #define PRJ_TEST
 #define PRJ_TEST
 
 
 
 
+#define USE_SMTP
+#define SMTP_SEND_BUILTIN
+
+#define USE_MQTT
+#define MQTT_SERVER_BUILTIN
+
+
 
 
 #if (defined PRJ_XIAN_AC_I1_O1_P4) || (defined PRJ_XIAN_AC_I1_O1_P8)  //GOM037
 #if (defined PRJ_XIAN_AC_I1_O1_P4) || (defined PRJ_XIAN_AC_I1_O1_P8)  //GOM037
     #define LANGUAGE                            0           //chinese
     #define LANGUAGE                            0           //chinese
@@ -42,9 +49,6 @@
         #define CHANNEL_DELAY                   8
         #define CHANNEL_DELAY                   8
     #endif
     #endif
 
 
-    #define USE_SMTP
-    #define SMTP_SEND_BUILTIN
-
     #define PROD_POWER_TYPE                     0
     #define PROD_POWER_TYPE                     0
     #define IN_INDEX_MAP                        {3,2,0,1}
     #define IN_INDEX_MAP                        {3,2,0,1}
 #elif (defined PRJ_USASL_AC_I3_O1) || (defined PRJ_USASL_AC_I3_O3)
 #elif (defined PRJ_USASL_AC_I3_O1) || (defined PRJ_USASL_AC_I3_O3)
@@ -57,9 +61,6 @@
     #define PHASE_GROUP                         8
     #define PHASE_GROUP                         8
     #define CHANNEL_DELAY                       8
     #define CHANNEL_DELAY                       8
 
 
-    #define USE_SMTP
-    #define SMTP_SEND_BUILTIN
-
     //#define PDU_GC40_03K_125H           //ac_in3_out3_40a_p8_12ch_nologo_en
     //#define PDU_GC40_03K_125H           //ac_in3_out3_40a_p8_12ch_nologo_en
     //#define PDU_GC60_04K_125H           //ac_in3_out1_40a_p4_24ch_nologo_en
     //#define PDU_GC60_04K_125H           //ac_in3_out1_40a_p4_24ch_nologo_en
     #ifdef PRJ_USASL_AC_I3_O1
     #ifdef PRJ_USASL_AC_I3_O1
@@ -79,9 +80,6 @@
     
     
     #define USE_LOGO_ITK
     #define USE_LOGO_ITK
 
 
-    #define USE_SMTP
-    #define SMTP_SEND_BUILTIN
-
     #ifdef PRJ_ITK_AC_I1_O1
     #ifdef PRJ_ITK_AC_I1_O1
         #define PROD_POWER_TYPE                 0
         #define PROD_POWER_TYPE                 0
     #else
     #else
@@ -96,9 +94,6 @@
     #define MAX_CHN_COUNT                       16
     #define MAX_CHN_COUNT                       16
     #define USE_LOGO_LITECH
     #define USE_LOGO_LITECH
 
 
-    #define USE_SMTP
-    #define SMTP_SEND_BUILTIN
-
     #ifdef PRJ_LITECH_AC_I1_O1
     #ifdef PRJ_LITECH_AC_I1_O1
         #define PHASE_GROUP                     8
         #define PHASE_GROUP                     8
         #define CHANNEL_DELAY                   8
         #define CHANNEL_DELAY                   8
@@ -120,9 +115,6 @@
     #define PHASE_GROUP                         8
     #define PHASE_GROUP                         8
     #define CHANNEL_DELAY                       8
     #define CHANNEL_DELAY                       8
 
 
-    #define USE_SMTP
-    #define SMTP_SEND_BUILTIN
-
     #define PROD_POWER_TYPE                     3
     #define PROD_POWER_TYPE                     3
 #elif defined PRJ_ANDERSON_AC_I3_O3
 #elif defined PRJ_ANDERSON_AC_I3_O3
     #define LANGUAGE                            1           //english
     #define LANGUAGE                            1           //english
@@ -134,12 +126,6 @@
     #define PHASE_GROUP                         8
     #define PHASE_GROUP                         8
     #define CHANNEL_DELAY                       8
     #define CHANNEL_DELAY                       8
 
 
-    #define USE_SMTP
-    #define SMTP_SEND_BUILTIN
-
-    #define USE_MQTT
-    #define MQTT_SERVER_BUILTIN
-
     #define USE_NF_CTRL
     #define USE_NF_CTRL
 
 
     #define PROD_POWER_TYPE                     3
     #define PROD_POWER_TYPE                     3
@@ -157,9 +143,6 @@
     
     
     #define USE_LOGO_HYPERTEC
     #define USE_LOGO_HYPERTEC
 
 
-    #define USE_SMTP
-    #define SMTP_SEND_BUILTIN
-
     #define PROD_POWER_TYPE                     5
     #define PROD_POWER_TYPE                     5
 #elif defined PRJ_INSPUR_DC_I_DC_O
 #elif defined PRJ_INSPUR_DC_I_DC_O
     #define LANGUAGE                            0           //english
     #define LANGUAGE                            0           //english
@@ -171,9 +154,6 @@
     #define PHASE_GROUP                         6
     #define PHASE_GROUP                         6
     #define CHANNEL_DELAY                       6
     #define CHANNEL_DELAY                       6
 
 
-    #define USE_SMTP
-    #define SMTP_SEND_BUILTIN
-
     #define PROD_POWER_TYPE                     1
     #define PROD_POWER_TYPE                     1
 #elif defined PRJ_SG_I3_O3
 #elif defined PRJ_SG_I3_O3
     #define LANGUAGE                            0           //english
     #define LANGUAGE                            0           //english
@@ -185,9 +165,6 @@
     #define PHASE_GROUP                         6
     #define PHASE_GROUP                         6
     #define CHANNEL_DELAY                       6
     #define CHANNEL_DELAY                       6
 
 
-    #define USE_SMTP
-    #define SMTP_SEND_BUILTIN
-
     #define PROD_POWER_TYPE                     3
     #define PROD_POWER_TYPE                     3
 #elif defined PRJ_TEST
 #elif defined PRJ_TEST
     #define LANGUAGE                            0           //chinese
     #define LANGUAGE                            0           //chinese
@@ -195,15 +172,9 @@
     #define SAVE_TIME                           60000       //ms
     #define SAVE_TIME                           60000       //ms
     #define CASCADE_CNT                         0
     #define CASCADE_CNT                         0
 
 
-    #define MAX_CHN_COUNT                       16//24//4
+    #define MAX_CHN_COUNT                       24//24//4
     #define PHASE_GROUP                         8
     #define PHASE_GROUP                         8
     #define CHANNEL_DELAY                       8
     #define CHANNEL_DELAY                       8
-    
-    #define USE_SMTP
-    #define SMTP_SEND_BUILTIN
-
-    #define USE_MQTT
-    #define MQTT_SERVER_BUILTIN
 
 
     #define PROD_POWER_TYPE                     5
     #define PROD_POWER_TYPE                     5
 #else
 #else

+ 1 - 2
pro/src/app.c

@@ -2244,9 +2244,8 @@ int app_init(void)
     cascade_init();
     cascade_init();
     netswitch_init();
     netswitch_init();
     smtp_init();
     smtp_init();
-#endif
-
     mqtt_init();
     mqtt_init();
+#endif
 
 
     websocket_init();
     websocket_init();
     appweb_init();
     appweb_init();

+ 7 - 6
pro/src/appweb_handle.c

@@ -401,7 +401,7 @@ static void http_mg_cb(struct mg_connection *c, int ev, void *ev_data)
         }
         }
     }
     }
     else if(ev == MG_EV_ACCEPT) {
     else if(ev == MG_EV_ACCEPT) {
-        if (c->is_tls) {
+        if (c->fn_data && c->is_tls) {
             mg_tls_init(c, &h->tls);
             mg_tls_init(c, &h->tls);
         }
         }
     }
     }
@@ -418,16 +418,17 @@ void *web_thread(void *arg)
     //mg_log_set(MG_LL_DEBUG);
     //mg_log_set(MG_LL_DEBUG);
     mg_mgr_init(&mgr);
     mg_mgr_init(&mgr);
 
 
-    //sys_get_path(h->rootDir, WEB_ROOT);
+    //sys_get_path(mh->rootDir, WEB_ROOT);
     strcpy(mh->rootDir, "/root/run/web");
     strcpy(mh->rootDir, "/root/run/web");
-    
+
+   
     if ((c = mg_http_listen(&mgr, http_addr, http_mg_cb, NULL)) == NULL) {
     if ((c = mg_http_listen(&mgr, http_addr, http_mg_cb, NULL)) == NULL) {
-        MG_ERROR(("cannot listen on %s. use http://address:port or :port\n", http_addr));
+        MG_ERROR(("cannot listen on %s\n", http_addr));
         return NULL;
         return NULL;
     }
     }
-    
+
     if ((c = mg_http_listen(&mgr, https_addr, http_mg_cb, NULL)) == NULL) {
     if ((c = mg_http_listen(&mgr, https_addr, http_mg_cb, NULL)) == NULL) {
-        MG_ERROR(("cannot listen on %s. use https://address:port or :port\n", https_addr));
+        MG_ERROR(("cannot listen on %s\n", https_addr));
         return NULL;
         return NULL;
     }
     }