4 Commit-ok a655581c33 ... ca50975265

Szerző SHA1 Üzenet Dátum
  zhangbo ca50975265 basecode release r1.4 3 éve
  zhangbo 81916edcb6 temporary backup 3 éve
  zhangbo 8912d6dad8 remove some logs 3 éve
  zhangbo d75ded3dad remove some logs 3 éve

+ 1 - 1
app/bmc/msghndlr/App/IPMDevice/IPMDevice.c

@@ -88,7 +88,7 @@ GetDevID ( uint8_t* pReq, uint8_t ReqLen,  uint8_t* pRes)
     static unsigned char MinorBCD;
     static int firsttime = 1;
 
-    printf("GetDevID ReqLen %d\n", ReqLen);
+//    printf("GetDevID ReqLen %d\n", ReqLen);
 
     if(firsttime == 1)
     {

+ 2 - 1
app/common_include/com_BMCCfg.h

@@ -5,8 +5,9 @@
 #define 	MAX_FAN_NUMS 	10		//该系统最多支持10个风扇
 #define 	BLADE_NUMBERS	10
 #define SENSOR_NUMBERS				(15)
+//r1.4 	网页初步成型,ASSERT NULL的错误解掉了,清除了日志。
 #define FW_VERSION_MAJOR			(1)
-#define FW_VERSION_MINOR			(3)
+#define FW_VERSION_MINOR			(4)
 
 extern uint8_t ChassisPrimaryIPMBAddr[BLADE_NUMBERS];
 extern uint8_t ChassisSecondaryIPMBAddr[BLADE_NUMBERS];

+ 11 - 11
app/goahead-3.6.5/paks/goahead-mbedtls/goahead-mbedtls.c

@@ -61,7 +61,7 @@ PUBLIC int sslOpen()
     mbedtls_ssl_config  *conf;
     int                 rc;
 
-    trace(7, "Initializing MbedTLS SSL"); 
+//    printf( "Initializing MbedTLS SSL"); 
 
     mbedtls_entropy_init(&cfg.entropy);
 
@@ -184,11 +184,11 @@ PUBLIC int sslOpen()
     if (websGetLogLevel() >= 5) {
         char    cipher[80];
         cint    *cp;
-        trace(5, "mbedtls: Supported Ciphers");
+        printf( "mbedtls: Supported Ciphers");
         for (cp = mbedtls_ssl_list_ciphersuites(); *cp; cp++) {
             scopy(cipher, sizeof(cipher), (char*) mbedtls_ssl_get_ciphersuite_name(*cp));
             replaceHyphen(cipher, '-', '_');
-            trace(5, "mbedtls: %s (0x%04X)", cipher, *cp);
+            printf( "mbedtls: %s (0x%04X)", cipher, *cp);
         }
     }
     return 0;
@@ -367,20 +367,20 @@ PUBLIC ssize sslRead(Webs *wp, void *buf, ssize len)
     }
     while (1) {
         rc = mbedtls_ssl_read(&mb->ctx, buf, (int) len);
-        trace(5, "mbedtls: mbedtls_ssl_read %d", rc);
+        printf( "mbedtls: mbedtls_ssl_read %d", rc);
         if (rc < 0) {
             if (rc == MBEDTLS_ERR_SSL_WANT_READ || rc == MBEDTLS_ERR_SSL_WANT_WRITE)  {
                 continue;
             } else if (rc == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
-                trace(5, "mbedtls: connection was closed gracefully");
+                printf( "mbedtls: connection was closed gracefully");
                 sp->flags |= SOCKET_EOF;
                 return -1;
             } else if (rc == MBEDTLS_ERR_NET_CONN_RESET) {
-                trace(5, "mbedtls: connection reset");
+                printf( "mbedtls: connection reset");
                 sp->flags |= SOCKET_EOF;
                 return -1;
             } else {
-                trace(4, "mbedtls: read error -0x%", -rc);
+                printf( "mbedtls: read error -0x%", -rc);
                 sp->flags |= SOCKET_EOF;
                 return -1; 
             }
@@ -414,17 +414,17 @@ PUBLIC ssize sslWrite(Webs *wp, void *buf, ssize len)
     totalWritten = 0;
     do {
         rc = mbedtls_ssl_write(&mb->ctx, (uchar*) buf, (int) len);
-        trace(7, "mbedtls write: wrote %d of %zd", rc, len);
+        printf( "mbedtls write: wrote %d of %zd", rc, len);
         if (rc <= 0) {
             if (rc == MBEDTLS_ERR_SSL_WANT_READ || rc == MBEDTLS_ERR_SSL_WANT_WRITE) {
                 socketSetError(EAGAIN);
                 return -1;
             }
             if (rc == MBEDTLS_ERR_NET_CONN_RESET) {
-                trace(4, "mbedtls_ssl_write peer closed");
+                printf( "mbedtls_ssl_write peer closed");
                 return -1;
             } else {
-                trace(4, "mbedtls_ssl_write failed rc %d", rc);
+                printf( "mbedtls_ssl_write failed rc %d", rc);
                 return -1;
             }
         } else {
@@ -552,7 +552,7 @@ static void traceMbed(void *context, int level, cchar *file, int line, cchar *st
     if (level <= websGetLogLevel()) {
         buf = sclone((char*) str);
         buf[slen(buf) - 1] = '\0';
-        trace(level, "%s", buf);
+        pirntf( "%s", buf);
         wfree(buf);
     }
 }

+ 15 - 15
app/goahead-3.6.5/src/auth.c

@@ -392,12 +392,12 @@ static void computeUserAbilities(WebsUser *user)
 #if ME_DEBUG
     {
         WebsKey *key;
-        trace(5 | WEBS_RAW_MSG, "User \"%s\" has abilities: ", user->name);
+        printf("User \"%s\" has abilities: ", user->name);
         for (key = hashFirst(user->abilities); key; key = hashNext(user->abilities, key)) {
-            trace(5 | WEBS_RAW_MSG, "%s ", key->name.value.string);
+            printf("%s ", key->name.value.string);
             ability = key->name.value.string;
         }
-        trace(5, "");
+        printf("");
     }
 #endif
     wfree(roles);
@@ -567,7 +567,7 @@ static void loginServiceProc(Webs *wp)
     websDone(wp);
 
     //这里的打印也不能去掉,猜测是这里的打印起了延时的作用。
-    printf("---> cJSON Str: %d \n%s\n", strlen(pStr), pStr);
+//    printf("---> cJSON Str: %d \n%s\n", strlen(pStr), pStr);
     if(pStr)
         wfree(pStr);
     if(root)
@@ -609,7 +609,7 @@ PUBLIC bool websVerifyPasswordFromFile(Webs *wp)
 
     assert(wp);
     if (!wp->user && (wp->user = websLookupUser(wp->username)) == 0) {
-        trace(5, "verifyUser: Unknown user \"%s\"", wp->username);
+        printf("verifyUser: Unknown user \"%s\"", wp->username);
         return 0;
     }
     /*
@@ -631,9 +631,9 @@ PUBLIC bool websVerifyPasswordFromFile(Webs *wp)
         printf("---> password: %s, user->password: %s\n", wp->password, wp->user->password);
     }
     if (success) {
-        trace(5, "User \"%s\" authenticated", wp->username);
+        printf( "User \"%s\" authenticated", wp->username);
     } else {
-        trace(5, "Password for user \"%s\" failed to authenticate", wp->username);
+        printf( "Password for user \"%s\" failed to authenticate", wp->username);
     }
     return success;
 }
@@ -665,11 +665,11 @@ PUBLIC bool websVerifyPasswordFromPam(Webs *wp)
     }
     if ((res = pam_authenticate(pamh, PAM_DISALLOW_NULL_AUTHTOK)) != PAM_SUCCESS) {
         pam_end(pamh, PAM_SUCCESS);
-        trace(5, "httpPamVerifyUser failed to verify %s", wp->username);
+        printf( "httpPamVerifyUser failed to verify %s", wp->username);
         return 0;
     }
     pam_end(pamh, PAM_SUCCESS);
-    trace(5, "httpPamVerifyUser verified %s", wp->username);
+    printf( "httpPamVerifyUser verified %s", wp->username);
 
     if (!wp->user) {
         wp->user = websLookupUser(wp->username);
@@ -690,7 +690,7 @@ PUBLIC bool websVerifyPasswordFromPam(Webs *wp)
                 }
             }
             bufAddNull(&abilities);
-            trace(5, "Create temp user \"%s\" with abilities: %s", wp->username, abilities.servp);
+            printf( "Create temp user \"%s\" with abilities: %s", wp->username, abilities.servp);
             if ((wp->user = websAddUser(wp->username, 0, abilities.servp)) == 0) {
                 return 0;
             }
@@ -969,25 +969,25 @@ static bool parseDigestDetails(Webs *wp)
     when = 0; secret = 0; realm = 0;
     decoded = parseDigestNonce(wp->nonce, &secret, &realm, &when);
     if (!smatch(masterSecret, secret)) {
-        trace(2, "Access denied: Nonce mismatch");
+        printf( "Access denied: Nonce mismatch");
         wfree(decoded);
         return 0;
     } else if (!smatch(realm, ME_GOAHEAD_REALM)) {
-        trace(2, "Access denied: Realm mismatch");
+        printf( "Access denied: Realm mismatch");
         wfree(decoded);
         return 0;
     } else if (!smatch(wp->qop, "auth")) {
-        trace(2, "Access denied: Bad qop");
+        printf("Access denied: Bad qop");
         wfree(decoded);
         return 0;
     } else if ((when + (5 * 60)) < time(0)) {
-        trace(2, "Access denied: Nonce is stale");
+        printf( "Access denied: Nonce is stale");
         wfree(decoded);
         return 0;
     }
     if (!wp->user) {
         if ((wp->user = websLookupUser(wp->username)) == 0) {
-            trace(2, "Access denied: user is unknown");
+            printf("Access denied: user is unknown");
             wfree(decoded);
             return 0;
         }

+ 28 - 28
app/goahead-3.6.5/src/cgi.c

@@ -139,7 +139,7 @@ PUBLIC bool cgiHandler(Webs *wp)
         websDecodeUrl(query, query, strlen(query));
         for (cp = stok(query, " ", &tok); cp != NULL; ) {
             *(argp+n) = cp;
-            trace(5, "ARG[%d] %s", n, argp[n-1]);
+            printf("ARG[%d] %s", n, argp[n-1]);
             n++;
             if (n >= argpsize) {
                 argpsize *= 2;
@@ -176,7 +176,7 @@ PUBLIC bool cgiHandler(Webs *wp)
             } else {
                 envp[n++] = sfmt("%s=%s", s->name.value.string, s->content.value.string);
             }
-            trace(0, "Env[%d] %s", n, envp[n-1]);
+            printf( "Env[%d] %s", n, envp[n-1]);
             if (n >= envpsize) {
                 envpsize *= 2;
                 envp = wrealloc(envp, envpsize * sizeof(char *));
@@ -250,11 +250,11 @@ PUBLIC bool websProcessCgiData(Webs *wp)
     ssize   nbytes;
 
     nbytes = bufLen(&wp->input);
-    trace(5, "cgi: write %d bytes to CGI program", nbytes);
+    printf( "cgi: write %d bytes to CGI program", nbytes);
     if (write(wp->cgifd, wp->input.servp, (int) nbytes) != nbytes) {
         websError(wp, HTTP_CODE_INTERNAL_SERVER_ERROR| WEBS_CLOSE, "Cannot write to CGI gateway");
     } else {
-        trace(5, "cgi: write %d bytes to CGI program", nbytes);
+        printf( "cgi: write %d bytes to CGI program", nbytes);
     }
     websConsumeInput(wp, nbytes);
     return 1;
@@ -263,7 +263,7 @@ PUBLIC bool websProcessCgiData(Webs *wp)
 
 static void writeCgiHeaders(Webs *wp, int status, ssize contentLength, char *location, char *contentType)
 {
-    trace(5, "cgi: Start response headers");
+    printf( "cgi: Start response headers");
     websSetStatus(wp, status);
     websWriteHeaders(wp, contentLength, location);
     websWriteHeader(wp, "Pragma", "no-cache");
@@ -328,7 +328,7 @@ static ssize parseCgiHeaders(Webs *wp, char *buf)
             if (key && value && !strspn(key, "%<>/\\")) {
                 websWriteHeader(wp, key, "%s", value);
             } else {
-                trace(5, "cgi: bad response http header: \"%s\": \"%s\"", key, value);
+                printf( "cgi: bad response http header: \"%s\": \"%s\"", key, value);
             }
         }
         stok(value, "\r\n", &cp);
@@ -367,21 +367,21 @@ PUBLIC void websCgiGatherOutput(Cgi *cgip)
                 if (!(wp->flags & WEBS_HEADERS_CREATED)) {
                     if ((skip = parseCgiHeaders(wp, buf)) == 0) {
                         if (cgip->handle && sbuf.st_size < ME_GOAHEAD_LIMIT_HEADERS) {
-                            trace(5, "cgi: waiting for http headers");
+                            printf( "cgi: waiting for http headers");
                             break;
                         } else {
-                            trace(5, "cgi: missing http headers - create default headers");
+                            printf( "cgi: missing http headers - create default headers");
                             writeCgiHeaders(wp, HTTP_CODE_OK, -1, 0, 0);
                         }
                     }
                 }
-                trace(5, "cgi: write %d bytes to client", nbytes - skip);
+                printf( "cgi: write %d bytes to client", nbytes - skip);
                 websWriteBlock(wp, &buf[skip], nbytes - skip);
                 cgip->fplacemark += (off_t) nbytes;
             }
             close(fdout);
         } else {
-            trace(5, "cgi: open failed");
+            printf( "cgi: open failed");
         }
     }
 }
@@ -397,7 +397,7 @@ int websCgiPoll()
     Cgi     *cgip;
     char    **ep;
     int     cid;
-
+    printf("Enter websCgiPoll()\n");
     for (cid = 0; cid < cgiMax; cid++) {
         if ((cgip = cgiList[cid]) != NULL) {
             wp = cgip->wp;
@@ -409,24 +409,24 @@ int websCgiPoll()
                 cgip->handle = 0;
                 websCgiGatherOutput(cgip);
 
-#if WINDOWS
-                /*
-                     Windows can have delayed notification through the file system after process exit.
-                 */
-                {
-                    int nTries;
-                    for (nTries = 0; (cgip->fplacemark == 0) && (nTries < 100); nTries++) {
-                        websCgiGatherOutput(cgip);
-                        if (cgip->fplacemark == 0) {
-                            Sleep(10);
-                        }
-                    }
-                }
-#endif
+// #if WINDOWS
+//                 /*
+//                      Windows can have delayed notification through the file system after process exit.
+//                  */
+//                 {
+//                     int nTries;
+//                     for (nTries = 0; (cgip->fplacemark == 0) && (nTries < 100); nTries++) {
+//                         websCgiGatherOutput(cgip);
+//                         if (cgip->fplacemark == 0) {
+//                             Sleep(10);
+//                         }
+//                     }
+//                 }
+// #endif
                 if (cgip->fplacemark == 0) {
                     websError(wp, HTTP_CODE_INTERNAL_SERVER_ERROR, "CGI generated no output");
                 } else {
-                    trace(5, "cgi: Request complete - calling websDone");
+                    printf( "cgi: Request complete - calling websDone");
                     websDone(wp);
                 }
                 /*
@@ -546,7 +546,7 @@ static CgiPid launchCgi(char *cgiPath, char **argp, char **envp, char *stdIn, ch
 {
     int     fdin, fdout, pid;
 
-    trace(5, "cgi: run %s", cgiPath);
+    printf( "cgi: run %s", cgiPath);
 
     if ((fdin = open(stdIn, O_RDWR | O_CREAT | O_BINARY, 0666)) < 0) {
         error("Cannot open CGI stdin: ", cgiPath);
@@ -599,7 +599,7 @@ static int checkCgi(CgiPid handle)
         Check to see if the CGI child process has terminated or not yet.
      */
     if ((pid = waitpid((CgiPid) handle, NULL, WNOHANG)) == handle) {
-        trace(5, "cgi: waited for pid %d", pid);
+        printf( "cgi: waited for pid %d", pid);
         return 0;
     } else {
         return 1;

+ 2 - 3
app/goahead-3.6.5/src/file.c

@@ -58,17 +58,16 @@ static bool fileHandler(Webs *wp)
                 wp->path[--nchars] = '\0';
             }
             tmp = sfmt("%s/%s", wp->path, websIndex);
-            printf("---> tmp: %s\n", tmp);
+            printf("Redirect %s\n", tmp);
             websRedirect(wp, tmp);
             wfree(tmp);
-            printf("---> fileHandler return 1\n");
             return 1;
         }
 //        printf(">>>>>>>>>>>>>>>>>>>>>>>>>>1.3>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
         if (websPageOpen(wp, O_RDONLY | O_BINARY, 0666) < 0) {
 #if ME_DEBUG
             if (wp->referrer) {
-                trace(1, "From %s", wp->referrer);
+                printf( "From %s", wp->referrer);
             }
 #endif
             websError(wp, HTTP_CODE_NOT_FOUND, "Cannot open document for: %s", wp->path);

+ 21 - 21
app/goahead-3.6.5/src/goahead-mbedtls/goahead-mbedtls.c

@@ -61,7 +61,7 @@ PUBLIC int sslOpen()
     mbedtls_ssl_config  *conf;
     int                 rc;
 
-    trace(7, "Initializing MbedTLS SSL"); 
+//    printf( "Initializing MbedTLS SSL"); 
 
     mbedtls_entropy_init(&cfg.entropy);
 
@@ -184,11 +184,11 @@ PUBLIC int sslOpen()
     if (websGetLogLevel() >= 5) {
         char    cipher[80];
         cint    *cp;
-        trace(5, "mbedtls: Supported Ciphers");
+        printf( "mbedtls: Supported Ciphers");
         for (cp = mbedtls_ssl_list_ciphersuites(); *cp; cp++) {
             scopy(cipher, sizeof(cipher), (char*) mbedtls_ssl_get_ciphersuite_name(*cp));
             replaceHyphen(cipher, '-', '_');
-            trace(5, "mbedtls: %s (0x%04X)", cipher, *cp);
+            printf( "mbedtls: %s (0x%04X)", cipher, *cp);
         }
     }
     return 0;
@@ -296,22 +296,22 @@ static int mbedHandshake(Webs *wp)
 
     } else if ((vrc = mbedtls_ssl_get_verify_result(&mb->ctx)) != 0) {
         if (vrc & MBEDTLS_X509_BADCERT_MISSING) {
-            logmsg(2, "Certificate missing");
+            printf( "Certificate missing");
 
         } else if (vrc & MBEDTLS_X509_BADCERT_EXPIRED) {
-            logmsg(2, "Certificate expired");
+            printf( "Certificate expired");
 
         } else if (vrc & MBEDTLS_X509_BADCERT_REVOKED) {
-            logmsg(2, "Certificate revoked");
+            printf( "Certificate revoked");
 
         } else if (vrc & MBEDTLS_X509_BADCERT_CN_MISMATCH) {
-            logmsg(2, "Certificate common name mismatch");
+            printf( "Certificate common name mismatch");
 
         } else if (vrc & MBEDTLS_X509_BADCERT_KEY_USAGE || vrc & MBEDTLS_X509_BADCERT_EXT_KEY_USAGE) {
-            logmsg(2, "Unauthorized key use in certificate");
+            printf( "Unauthorized key use in certificate");
 
         } else if (vrc & MBEDTLS_X509_BADCERT_NOT_TRUSTED) {
-            logmsg(2, "Certificate not trusted");
+            printf( "Certificate not trusted");
             if (!ME_GOAHEAD_SSL_VERIFY_ISSUER) {
                 vrc = 0;
             }
@@ -324,18 +324,18 @@ static int mbedHandshake(Webs *wp)
 
         } else {
             if (mb->ctx.client_auth && !*ME_GOAHEAD_SSL_CERTIFICATE) {
-                logmsg(2, "Server requires a client certificate");
+                printf( "Server requires a client certificate");
 
             } else if (rc == MBEDTLS_ERR_NET_CONN_RESET) {
-                logmsg(2, "Peer disconnected");
+                printf( "Peer disconnected");
 
             } else {
-                logmsg(2, "Cannot handshake: error -0x%x", -rc);
+                printf( "Cannot handshake: error -0x%x", -rc);
             }
         }
         if (vrc != 0 && ME_GOAHEAD_SSL_VERIFY_PEER) {
             if (mbedtls_ssl_get_peer_cert(&mb->ctx) == 0) {
-                logmsg(2, "Peer did not provide a certificate");
+                printf( "Peer did not provide a certificate");
             }
             sp->flags |= SOCKET_EOF;
             errno = EPROTO;
@@ -367,20 +367,20 @@ PUBLIC ssize sslRead(Webs *wp, void *buf, ssize len)
     }
     while (1) {
         rc = mbedtls_ssl_read(&mb->ctx, buf, (int) len);
-        trace(5, "mbedtls: mbedtls_ssl_read %d", rc);
+        printf( "mbedtls: mbedtls_ssl_read %d", rc);
         if (rc < 0) {
             if (rc == MBEDTLS_ERR_SSL_WANT_READ || rc == MBEDTLS_ERR_SSL_WANT_WRITE)  {
                 continue;
             } else if (rc == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
-                trace(5, "mbedtls: connection was closed gracefully");
+                printf( "mbedtls: connection was closed gracefully");
                 sp->flags |= SOCKET_EOF;
                 return -1;
             } else if (rc == MBEDTLS_ERR_NET_CONN_RESET) {
-                trace(5, "mbedtls: connection reset");
+                printf( "mbedtls: connection reset");
                 sp->flags |= SOCKET_EOF;
                 return -1;
             } else {
-                trace(4, "mbedtls: read error -0x%", -rc);
+                printf( "mbedtls: read error -0x%", -rc);
                 sp->flags |= SOCKET_EOF;
                 return -1; 
             }
@@ -414,17 +414,17 @@ PUBLIC ssize sslWrite(Webs *wp, void *buf, ssize len)
     totalWritten = 0;
     do {
         rc = mbedtls_ssl_write(&mb->ctx, (uchar*) buf, (int) len);
-        trace(7, "mbedtls write: wrote %d of %zd", rc, len);
+        printf( "mbedtls write: wrote %d of %zd", rc, len);
         if (rc <= 0) {
             if (rc == MBEDTLS_ERR_SSL_WANT_READ || rc == MBEDTLS_ERR_SSL_WANT_WRITE) {
                 socketSetError(EAGAIN);
                 return -1;
             }
             if (rc == MBEDTLS_ERR_NET_CONN_RESET) {
-                trace(4, "mbedtls_ssl_write peer closed");
+                printf( "mbedtls_ssl_write peer closed");
                 return -1;
             } else {
-                trace(4, "mbedtls_ssl_write failed rc %d", rc);
+                printf( "mbedtls_ssl_write failed rc %d", rc);
                 return -1;
             }
         } else {
@@ -552,7 +552,7 @@ static void traceMbed(void *context, int level, cchar *file, int line, cchar *st
     if (level <= websGetLogLevel()) {
         buf = sclone((char*) str);
         buf[slen(buf) - 1] = '\0';
-        trace(level, "%s", buf);
+        printf( "%s", buf);
         wfree(buf);
     }
 }

+ 4 - 4
app/goahead-3.6.5/src/goahead-openssl/goahead-openssl.c

@@ -738,14 +738,14 @@ static int verifyClientCertificate(int ok, X509_STORE_CTX *xContext)
     case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
     case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
         if (ME_GOAHEAD_SSL_VERIFY_ISSUER) {
-            logmsg(3, "Self-signed certificate");
+            printf( "Self-signed certificate");
             ok = 0;
         }
 
     case X509_V_ERR_CERT_UNTRUSTED:
     case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
         if (ME_GOAHEAD_SSL_VERIFY_ISSUER) {
-            logmsg(3, "Certificate not trusted");
+            printf( "Certificate not trusted");
             ok = 0;
         }
         break;
@@ -753,7 +753,7 @@ static int verifyClientCertificate(int ok, X509_STORE_CTX *xContext)
     case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
     case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
         if (ME_GOAHEAD_SSL_VERIFY_ISSUER) {
-            logmsg(3, "Certificate not trusted");
+            printf( "Certificate not trusted");
             ok = 0;
         }
         break;
@@ -767,7 +767,7 @@ static int verifyClientCertificate(int ok, X509_STORE_CTX *xContext)
     case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
     case X509_V_ERR_INVALID_CA:
     default:
-        logmsg(3, "Certificate verification error %d", error);
+        printf( "Certificate verification error %d", error);
         ok = 0;
         break;
     }

+ 13 - 20
app/goahead-3.6.5/src/goahead.c

@@ -126,16 +126,12 @@ MAIN(goahead, int argc, char **argv, char **envp)
     if (argc > argind) {
         documents = argv[argind++];
     }
- //   printf("---> initPlatform\n");
     initPlatform(); //注册信号
- //   printf("---> websOpen\n");
-//    printf(">>>>>>>>>>>>>>>>>>>>>>>>>>2>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
     if (websOpen(documents, route) < 0) {
         error("Cannot initialize server. Exiting.");
         return -1;
     }
 #if ME_GOAHEAD_AUTH
-//    printf("---> websLoad\n");
     if (websLoad(auth) < 0) {
         error("Cannot load %s", auth);
         return -1;
@@ -145,7 +141,6 @@ MAIN(goahead, int argc, char **argv, char **envp)
     if (argind < argc) {
         while (argind < argc) {
             endpoint = argv[argind++];
-//            printf("---> websListen log1\n");
             if (websListen(endpoint) < 0) {
                 return -1;
             }
@@ -156,7 +151,6 @@ MAIN(goahead, int argc, char **argv, char **envp)
 #if !ME_COM_SSL
             if (strstr(endpoint, "https")) continue;
 #endif
-//            printf("---> websListen log2\n");
             if (websListen(endpoint) < 0) {
                 wfree(endpoints);
                 return -1;
@@ -250,10 +244,8 @@ websDefineAction("web_RestoreConfig", web_RestoreConfig);
         }
     }
 #endif
-    printf("---> websServiceEvents\n");
     websServiceEvents(&finished);
-    logmsg(1, "Instructed to exit");
-    printf("---> websClose\n");
+    printf("Instructed to exit");
     websClose();
 #if WINDOWS
     windowsClose();
@@ -267,17 +259,18 @@ static void logHeader()
     char    home[ME_GOAHEAD_LIMIT_STRING];
 
     getcwd(home, sizeof(home));
-    logmsg(2, "Configuration for %s", ME_TITLE);
-    logmsg(2, "---------------------------------------------");
-    logmsg(2, "Version:            %s", ME_VERSION);
-    logmsg(2, "BuildType:          %s", ME_DEBUG ? "Debug" : "Release");
-    logmsg(2, "CPU:                %s", ME_CPU);
-    logmsg(2, "OS:                 %s", ME_OS);
-    logmsg(2, "Host:               %s", websGetServer());
-    logmsg(2, "Directory:          %s", home);
-    logmsg(2, "Documents:          %s", websGetDocuments());
-    logmsg(2, "Configure:          %s", ME_CONFIG_CMD);
-    logmsg(2, "---------------------------------------------");
+    //printf( "Configuration for %s\n", ME_TITLE);
+    printf( "\ngoahead web server start\n");
+    printf( "---------------------------------------------\n");
+    printf( "  Version:      %s\n", ME_VERSION);
+    printf( "  BuildType:    %s\n", ME_DEBUG ? "Debug" : "Release");
+    printf( "  CPU:          %s\n", ME_CPU);
+    printf( "  OS:           %s\n", ME_OS);
+    printf( "  Host:         %s\n", websGetServer());
+    printf( "  Directory:    %s\n", home);
+    printf( "  Documents:    %s\n", websGetDocuments());
+    printf( "  Configure:    %s\n", ME_CONFIG_CMD);
+    printf( "---------------------------------------------\n");
 }
 
 

+ 37 - 37
app/goahead-3.6.5/src/goahead.h

@@ -171,43 +171,43 @@ PUBLIC_DATA int logLevel;
 #define WEBS_TRACE_MSG      0x400       /**< Originated from trace */
 
 
-#if ME_GOAHEAD_TRACING && ME_GOAHEAD_LOGGING
-    #if ME_COMPILER_HAS_MACRO_VARARGS
-      #define trace(l, ...) if (((l) & WEBS_LEVEL_MASK) <= websGetLogLevel()) { traceProc(l, __VA_ARGS__); } else {}
-    #else
-        inline void trace(int level, cchar *fmt, ...) {
-            WebsLogHandler logHandler = logGetHandler();
-            if ((level & WEBS_LEVEL_MASK) <= logLevel && logHandler) {
-                va_list args; va_start(args, fmt);
-                char *message = sfmtv((char*) fmt, args);
-                logHandler(level | WEBS_TRACE_MSG, message);
-                wfree(message);
-                va_end(args);
-            }
-        }
-    #endif
-#else
-    #define trace(l, ...) if (1) ; else {}
-#endif
-
-#if ME_GOAHEAD_LOGGING
-    #if ME_COMPILER_HAS_MACRO_VARARGS
-        #define logmsg(l, ...) if ((l) <= logLevel) { logmsgProc(l, __VA_ARGS__); } else {}
-    #else
-        inline void logmsg(int level, cchar *fmt, ...) {
-            WebsLogHandler logHandler = logGetHandler();
-            if ((level & WEBS_LEVEL_MASK) <= logLevel && logHandler) {
-                va_list args; va_start(args, fmt);
-                char *message = sfmtv((char*) fmt, args);
-                logHandler(level | WEBS_TRACE_MSG, message);
-                wfree(message);
-                va_end(args);
-            }
-        }
-    #endif
-#else
-    #define logmsg(l, ...) if (1) ; else {}
-#endif
+// #if ME_GOAHEAD_TRACING && ME_GOAHEAD_LOGGING
+//     #if ME_COMPILER_HAS_MACRO_VARARGS
+//       #define trace(l, ...) if (((l) & WEBS_LEVEL_MASK) <= websGetLogLevel()) { traceProc(l, __VA_ARGS__); } else {}
+//     #else
+//         inline void trace(int level, cchar *fmt, ...) {
+//             WebsLogHandler logHandler = logGetHandler();
+//             if ((level & WEBS_LEVEL_MASK) <= logLevel && logHandler) {
+//                 va_list args; va_start(args, fmt);
+//                 char *message = sfmtv((char*) fmt, args);
+//                 logHandler(level | WEBS_TRACE_MSG, message);
+//                 wfree(message);
+//                 va_end(args);
+//             }
+//         }
+//     #endif
+// #else
+//     #define trace(l, ...) if (1) ; else {}
+// #endif
+
+// #if ME_GOAHEAD_LOGGING
+//     #if ME_COMPILER_HAS_MACRO_VARARGS
+//         #define logmsg(l, ...) if ((l) <= logLevel) { logmsgProc(l, __VA_ARGS__); } else {}
+//     #else
+//         inline void logmsg(int level, cchar *fmt, ...) {
+//             WebsLogHandler logHandler = logGetHandler();
+//             if ((level & WEBS_LEVEL_MASK) <= logLevel && logHandler) {
+//                 va_list args; va_start(args, fmt);
+//                 char *message = sfmtv((char*) fmt, args);
+//                 logHandler(level | WEBS_TRACE_MSG, message);
+//                 wfree(message);
+//                 va_end(args);
+//             }
+//         }
+//     #endif
+// #else
+//     #define logmsg(l, ...) if (1) ; else {}
+// #endif
 
 
 #if DOXYGEN

+ 29 - 29
app/goahead-3.6.5/src/http.c

@@ -295,7 +295,7 @@ PUBLIC void websClose()
     Webs    *wp;
     int     i;
 
-printf("%s %d ---> websClose()\n", __FILE__, __LINE__);
+//printf("%s %d ---> websClose()\n", __FILE__, __LINE__);
     websCloseRoute();
 #if ME_GOAHEAD_AUTH
     websCloseAuth();
@@ -579,7 +579,7 @@ PUBLIC void websDone(Webs *wp)
     logRequest(wp, wp->code);
 #endif
     if (!(wp->flags & WEBS_RESPONSE_TRACED)) {
-        trace(3 | WEBS_RAW_MSG, "Request complete: code %d", wp->code);
+        printf("Request complete: code %d", wp->code);
     }
 }
 
@@ -593,10 +593,10 @@ static int complete(Webs *wp, int reuse)
     if (reuse && wp->flags & WEBS_KEEP_ALIVE && wp->rxRemaining == 0) {
         reuseConn(wp);
         socketCreateHandler(wp->sid, SOCKET_READABLE, socketEvent, wp);
-        trace(5, "Keep connection alive");
+        //printf( "Keep connection alive");
         return 1;
     }
-    trace(5, "Close connection");
+    //printf("Close connection");
     wp->state = WEBS_BEGIN;
     wp->flags |= WEBS_CLOSED;
     return 0;
@@ -635,7 +635,7 @@ PUBLIC int websListen(char *endpoint)
     } else {
         ipaddr = "*";
     }
-    printf("Started %s://%s:%d", secure ? "https" : "http", ipaddr, port);
+    //printf("Started %s://%s:%d", secure ? "https" : "http", ipaddr, port);
 
     if (!websHostUrl) {
         if (port == 80) {
@@ -707,12 +707,12 @@ PUBLIC int websAccept(int sid, char *ipaddr, int port, int listenSid)
         Arrange for socketEvent to be called when read data is available
      */
     lp = socketPtr(listenSid);
-    trace(4, "New connection from %s:%d to %s:%d", ipaddr, port, wp->ifaddr, lp->port);
+    //printf( "New connection from %s:%d to %s:%d", ipaddr, port, wp->ifaddr, lp->port);
 
 #if ME_COM_SSL
     if (lp->secure) {
         wp->flags |= WEBS_SECURE;
-        trace(4, "Upgrade connection to TLS");
+        //printf( "Upgrade connection to TLS");
         if (sslUpgrade(wp) < 0) {
             error("Cannot upgrade to TLS");
             return -1;
@@ -896,10 +896,10 @@ static bool parseIncoming(Webs *wp)
         }
         return 0;
     }
-    trace(3 | WEBS_RAW_MSG, "\n<<< Request\n");
+    //printf("\n<<< Request\n");
     c = *end;
     *end = '\0';
-    trace(3 | WEBS_RAW_MSG, "%s\n", wp->rxbuf.servp);
+    //printf( "%s\n", wp->rxbuf.servp);
     *end = c;
 
     /*
@@ -980,9 +980,9 @@ static void parseFirstLine(Webs *wp)
         return;
     }
     protoVer = getToken(wp, "\r\n");
-    if (websGetLogLevel() == 2) {
-        trace(2, "%s %s %s", wp->method, url, protoVer);
-    }
+    // if (websGetLogLevel() == 2) {
+    //     printf("===> %s %s %s", wp->method, url, protoVer);
+    // }
 
     /*
         Parse the URL and store all the various URL components. websUrlParse returns an allocated buffer in buf which we
@@ -1324,7 +1324,7 @@ static bool filterChunkData(Webs *wp)
                 wp->eof = 1;
                 return 1;
             }
-            trace(7, "chunkFilter: start incoming chunk of %d bytes", chunkSize);
+            printf( "chunkFilter: start incoming chunk of %d bytes", chunkSize);
             wp->rxChunkState = WEBS_CHUNK_DATA;
             break;
 
@@ -1333,7 +1333,7 @@ static bool filterChunkData(Webs *wp)
             nbytes = min(bufRoom(&wp->input), len);
 //            printf("---> bufPutBlk2 len = %d\n", len);
             if (len > 0 && (nbytes = bufPutBlk(&wp->input, rxbuf->servp, nbytes)) == 0) {
-                printf("<<<<<<<<<<<<<<>>42222>>>>>>>>>>>>\n" );
+                //printf("<<<<<<<<<<<<<<>>42222>>>>>>>>>>>>\n" );
                 websError(wp, HTTP_CODE_REQUEST_TOO_LARGE | WEBS_CLOSE, "Too big");
                 return 1;
             }
@@ -1652,7 +1652,7 @@ PUBLIC void websRedirect(Webs *wp, char *uri)
         }
     }
 
-    printf("---> originalPort: %d, hostbuf: %s\n", originalPort, hostbuf);
+    //printf("---> originalPort: %d, hostbuf: %s\n", originalPort, hostbuf);
     if (smatch(uri, "http://") || smatch(uri, "https://")) {
         /* Protocol switch with existing Uri */
         scheme = sncmp(uri, "https", 5) == 0 ? "https" : "http";
@@ -1796,7 +1796,7 @@ PUBLIC int websWriteHeader(Webs *wp, char *key, char *fmt, ...)
 
     if (!(wp->flags & WEBS_RESPONSE_TRACED)) {
         wp->flags |= WEBS_RESPONSE_TRACED;
-        trace(3 | WEBS_RAW_MSG, "\n>>> Response\n");
+//        printf( "\n>>> Response\n");
     }
     if (key) {
         if (websWriteBlock(wp, key, strlen(key)) < 0) {
@@ -1805,7 +1805,7 @@ PUBLIC int websWriteHeader(Webs *wp, char *key, char *fmt, ...)
         if (websWriteBlock(wp, ": ", 2) < 0) {
             return -1;
         }
-        trace(3 | WEBS_RAW_MSG, "%s: ", key);
+        //printf("===> %s: ", key);
     }
     if (fmt) {
         va_start(vargs, fmt);
@@ -1815,7 +1815,7 @@ PUBLIC int websWriteHeader(Webs *wp, char *key, char *fmt, ...)
         }
         va_end(vargs);
         assert(strstr(buf, "UNION") == 0);
-        trace(3 | WEBS_RAW_MSG, "%s", buf);
+        //printf("===> %s", buf);
         if (websWriteBlock(wp, buf, strlen(buf)) < 0) {
             return -1;
         }
@@ -1824,7 +1824,7 @@ PUBLIC int websWriteHeader(Webs *wp, char *key, char *fmt, ...)
             return -1;
         }
     }
-    trace(3 | WEBS_RAW_MSG, "\r\n");
+    //printf("\r\n");
     return 0;
 }
 
@@ -2079,15 +2079,15 @@ PUBLIC int websFlush(Webs *wp, bool block)
     }
     op = &wp->output;
     if (wp->flags & WEBS_CHUNKING) {
-        trace(6, "websFlush chunking finalized %d", wp->finalized);
+        //printf("websFlush chunking finalized %d", wp->finalized);
         if (flushChunkData(wp) && wp->finalized) {
-            trace(6, "websFlush: write chunk trailer");
+            //printf("websFlush: write chunk trailer");
             bufPutStr(op, "\r\n0\r\n\r\n");
             bufAddNull(op);
             wp->flags &= ~WEBS_CHUNKING;
         }
     }
-    trace(6, "websFlush: buflen %d", bufLen(op));
+//    printf( "websFlush: buflen %d", bufLen(op));
     written = 0;
     while ((nbytes = bufLen(op)) > 0) {
         if ((written = websWriteSocket(wp, op->servp, nbytes)) < 0) {
@@ -2107,7 +2107,7 @@ PUBLIC int websFlush(Webs *wp, bool block)
         } else if (written == 0) {
             break;
         }
-        trace(6, "websFlush: wrote %d to socket", written);
+        //printf( "websFlush: wrote %d to socket", written);
         bufAdjustStart(op, written);
         bufCompact(op);
         nbytes = bufLen(op);
@@ -2391,7 +2391,7 @@ static int setLocalHost()
     get_local_ip("eth0", ipaddr);
     websSetIpAddr(ipaddr);
     websSetHost(ipaddr);
-    printf("---> setLocalHost, ip = %s\n", ipaddr);
+    //printf("---> setLocalHost, ip = %s\n", ipaddr);
     return 0;
 }
 
@@ -3217,9 +3217,9 @@ static void pruneSessions()
                 freeSession(sp);
             }
         }
-        if (oldCount != sessionCount || sessionCount) {
-            trace(4, "Prune %d sessions. Remaining: %d", oldCount - sessionCount, sessionCount);
-        }
+        // if (oldCount != sessionCount || sessionCount) {
+        //     printf("Prune %d sessions. Remaining: %d", oldCount - sessionCount, sessionCount);
+        // }
     }
     websRestartEvent(pruneId, WEBS_SESSION_PRUNE);
 }
@@ -3299,7 +3299,7 @@ static void setFileLimits()
         }
     }
     getrlimit(RLIMIT_NOFILE, &r);
-    trace(6, "Max files soft %d, max %d", r.rlim_cur, r.rlim_max);
+    //printf("Max files soft %d, max %d", (int)r.rlim_cur, (int)r.rlim_max);
 #endif
 }
 
@@ -3338,7 +3338,7 @@ PUBLIC void websError(Webs *wp, int code, char *fmt, ...)
             va_start(args, fmt);
             msg = sfmtv(fmt, args);
             va_end(args);
-            trace(2, "%s", msg);
+            printf( "%s", msg);
             wfree(msg);
         }
         buf = sfmt("\

+ 2 - 2
app/goahead-3.6.5/src/libipmi/src/libipmi_session.c

@@ -64,7 +64,7 @@ uint16_t LIBIPMI_CreateSession(IPMI20_UDS_SESSION_T *pUDSSession, int timeout)
         printf("LIBIPMI_UDS_SESSION.C: Unable to connect to Server:\n");
         return LIBIPMI_MEDIUM_E_CONNECT_FAILURE;
     }
-    printf("---> Create_IPMI20_UDS_Session %d\n", client_sock);
+//    printf("---> Create_IPMI20_UDS_Session %d\n", client_sock);
 
     pUDSSession->hUDSInfo.hSocket = client_sock;
     pUDSSession->hUDSInfo.byIsConnected = 1;
@@ -224,7 +224,7 @@ Closes the connection with BMC
 ----------------------------------------------------------------------*/
 uint16_t LIBIPMI_CloseSession( IPMI20_UDS_SESSION_T *pUDSSession )
 {
-    printf("LIBIPMI_CloseSession %d\n", pUDSSession->hUDSInfo.hSocket);
+    //printf("LIBIPMI_CloseSession %d\n", pUDSSession->hUDSInfo.hSocket);
     close(pUDSSession->hUDSInfo.hSocket);
     /* reset the connected flag */
     pUDSSession->hUDSInfo.byIsConnected = 0;

+ 6 - 6
app/goahead-3.6.5/src/route.c

@@ -79,7 +79,7 @@ PUBLIC void websRouteRequest(Webs *wp)
 
         if (plen < route->prefixLen) continue;
         len = min(route->prefixLen, plen);
-        trace(5, "Examine route %s", route->prefix);
+//        printf( "Examine route %s", route->prefix);
         /*
             Match route
          */
@@ -87,19 +87,19 @@ PUBLIC void websRouteRequest(Webs *wp)
             continue;
         }
         if (route->protocol && !smatch(route->protocol, wp->protocol)) {
-            trace(5, "Route %s does not match protocol %s", route->prefix, wp->protocol);
+            //printf( "Route %s does not match protocol %s", route->prefix, wp->protocol);
             continue;
         }
         if (route->methods >= 0) {
             if (!hashLookup(route->methods, wp->method)) {
-                trace(5, "Route %s does not match method %s", route->prefix, wp->method);
+                //printf( "Route %s does not match method %s", route->prefix, wp->method);
                 continue;
             }
         } else if (!safeMethod) {
             continue;
         }
         if (route->extensions >= 0 && (wp->ext == 0 || !hashLookup(route->extensions, &wp->ext[1]))) {
-            trace(5, "Route %s doesn match extension %s", route->prefix, wp->ext ? wp->ext : "");
+            //printf( "Route %s doesn match extension %s", route->prefix, wp->ext ? wp->ext : "");
             continue;
         }
 
@@ -168,7 +168,7 @@ PUBLIC bool websRunRequest(Webs *wp)
         wp->flags |= WEBS_VARS_ADDED;
     }
     wp->state = WEBS_RUNNING;
-    trace(5, "Route %s calls handler %s", route->prefix, route->handler->name);
+    //printf( "Route %s calls handler %s", route->prefix, route->handler->name);
 
 #if ME_GOAHEAD_LEGACY
     if (route->handler->flags & WEBS_LEGACY_HANDLER) {
@@ -261,7 +261,7 @@ PUBLIC bool websCanString(Webs *wp, char *abilities)
             return 0;
         }
         if ((user = websLookupUser(wp->username)) == 0) {
-            trace(2, "Cannot find user %s", wp->username);
+            printf( "Cannot find user %s", wp->username);
             return 0;
         }
     }

+ 11 - 10
app/goahead-3.6.5/src/socket.c

@@ -49,13 +49,14 @@ PUBLIC int socketOpen()
     socketList = NULL;
     socketMax = 0;
     socketHighestFd = -1;
-    if ((fd = socket(AF_INET6, SOCK_STREAM, 0)) != -1) {
-        hasIPv6 = 1;
-        printf("%s %d ---> closesocket\n", __FILE__, __LINE__);
-        closesocket(fd);
-    } else {
-        printf("This system does not have IPv6 support");
-    }
+    //这个系统不支持IPv6
+    // if ((fd = socket(AF_INET6, SOCK_STREAM, 0)) != -1) {
+    //     hasIPv6 = 1;
+    //     //printf("%s %d ---> closesocket\n", __FILE__, __LINE__);
+    //     closesocket(fd);
+    // } else {
+    //     printf("This system does not have IPv6 support");
+    // }
     return 0;
 }
 
@@ -947,9 +948,9 @@ PUBLIC void socketFree(int sid)
             while (recv(sp->sock, buf, sizeof(buf), 0) > 0) {}
         }
         
-        printf("---> closesocket header %d\n",sp->sock);
+        //printf("---> closesocket header %d\n",sp->sock);
         closesocket(sp->sock);
-        printf("---> closesocket tail\n");
+        //printf("---> closesocket tail\n");
     }
     wfree(sp->ip);
     wfree(sp);
@@ -972,7 +973,7 @@ PUBLIC void socketFree(int sid)
  */
 WebsSocket *socketPtr(int sid)
 {
-    printf("---> socketPtr(): sid = %d, socketMax = %d\n", sid, socketMax);
+    //printf("---> socketPtr(): sid = %d, socketMax = %d\n", sid, socketMax);
     if (sid < 0 || sid >= socketMax || socketList[sid] == NULL) {
         assert(NULL);
         errno = EBADF;

+ 7 - 7
app/goahead-3.6.5/src/upload.c

@@ -188,7 +188,7 @@ static void processUploadHeader(Webs *wp, char *line)
         wp->uploadState = UPLOAD_CONTENT_DATA;
         return;
     }
-    trace(7, "Header line: %s", line);
+    printf( "Header line: %s", line);
 
     headerTok = line;
     stok(line, ": ", &rest);
@@ -250,7 +250,7 @@ static void processUploadHeader(Webs *wp, char *line)
                     return;
                 }
 
-                trace(5, "File upload of: %s stored as %s", wp->clientFilename, wp->uploadTmp);
+                printf( "File upload of: %s stored as %s", wp->clientFilename, wp->uploadTmp);
 
                 if ((wp->upfd = open(wp->uploadTmp, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0600)) < 0) {
                     websError(wp, HTTP_CODE_INTERNAL_SERVER_ERROR, "Cannot open upload temp file %s", wp->uploadTmp);
@@ -270,7 +270,7 @@ static void processUploadHeader(Webs *wp, char *line)
 
     } else if (scaselesscmp(headerTok, "Content-Type") == 0) {
         if (wp->clientFilename) {
-            trace(5, "Set files[%s][CONTENT_TYPE] = %s", wp->uploadVar, rest);
+            printf( "Set files[%s][CONTENT_TYPE] = %s", wp->uploadVar, rest);
             wp->currentFile->contentType = sclone(rest);
         }
     }
@@ -318,7 +318,7 @@ static int writeToFile(Webs *wp, char *data, ssize len)
             return -1;
         }
         file->size += len;
-        trace(7, "uploadFilter: Wrote %d bytes to %s", len, wp->uploadTmp);
+        printf( "uploadFilter: Wrote %d bytes to %s", len, wp->uploadTmp);
     }
     return 0;
 }
@@ -345,7 +345,7 @@ static bool processContentData(Webs *wp)
         return 0;
     }
     if ((bp = getBoundary(wp, content->servp, size)) == 0) {
-        trace(7, "uploadFilter: Got boundary filename %x", wp->clientFilename);
+        printf( "uploadFilter: Got boundary filename %x", wp->clientFilename);
         if (wp->clientFilename) {
             /*
                 No signature found yet. probably more data to come. Must handle split boundaries.
@@ -389,7 +389,7 @@ static bool processContentData(Webs *wp)
                 Normal string form data variables
              */
             data[nbytes] = '\0';
-            trace(5, "uploadFilter: form[%s] = %s", wp->uploadVar, data);
+            printf( "uploadFilter: form[%s] = %s", wp->uploadVar, data);
             websDecodeUrl(wp->uploadVar, wp->uploadVar, -1);
             websDecodeUrl(data, data, -1);
             websSetVar(wp, wp->uploadVar, data);
@@ -472,7 +472,7 @@ PUBLIC void websUploadOpen()
         uploadDir = "/tmp";
 #endif
     }
-    trace(4, "Upload directory is %s", uploadDir);
+//    printf( "Upload directory is %s", uploadDir);
     websDefineHandler("upload", 0, uploadHandler, 0, 0);
 }
 

+ 4 - 4
app/goahead-3.6.5/src/utils/mine/ResultUtils.c

@@ -39,7 +39,7 @@ static void commResult(Webs *wp, int msgCode, int httpStatus, int isSuccess) {
     
 
     // memcpy(cjson_str, pStr, strlen(pStr));
-    logmsg(2, "-----------------------jso1n----------------------%s", pStr);
+    printf( "-----------------------jso1n----------------------%s", pStr);
     websResponse(wp, httpStatus, pStr);
     cJSON_Delete(root);//free memery
     wfree(pStr);
@@ -52,7 +52,7 @@ static void commResult(Webs *wp, int msgCode, int httpStatus, int isSuccess) {
 //add by lusa 
 void getErrorJson(char *cjson_str, int cjson_code)
 {
-    logmsg(2, "-----------------------json----------------------");
+    printf( "-----------------------json----------------------");
     char *pStr;
     cJSON * root =  cJSON_CreateObject();
     cJSON * data =  cJSON_CreateObject();
@@ -64,11 +64,11 @@ void getErrorJson(char *cjson_str, int cjson_code)
     
 
     pStr = cJSON_Print(root);
-     logmsg(2, "-----------------------jso1n----------------------%s", pStr);
+     printf( "-----------------------jso1n----------------------%s", pStr);
     //cjson_str = sfmt("%s", pStr);
     // printf("---> pStr: %s\n", pStr);
     
     memcpy(cjson_str, pStr, strlen(pStr));
-    logmsg(2, "-----------------------json-2------ %d ---------------%s", strlen(pStr), cjson_str);
+    printf( "-----------------------json-2------ %d ---------------%s", strlen(pStr), cjson_str);
 
 }

+ 9 - 9
app/goahead-3.6.5/src/web_interface/src/config.c

@@ -70,7 +70,7 @@ void restoreFactorySettings(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -119,7 +119,7 @@ void web_ResetBMC(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -208,7 +208,7 @@ void web_GetLanInfo(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -316,7 +316,7 @@ void web_SetLanInfo(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -349,7 +349,7 @@ void web_GetRunTime(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -402,7 +402,7 @@ void web_SetModIdentifyOn(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -432,7 +432,7 @@ void web_SetModIdentifyOff(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -460,7 +460,7 @@ void web_SaveConfig(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -488,7 +488,7 @@ void web_RestoreConfig(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);

+ 5 - 5
app/goahead-3.6.5/src/web_interface/src/dashboard.c

@@ -117,7 +117,7 @@ void getDeviceInfo(Webs *wp){
     websWrite(wp, "%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -189,7 +189,7 @@ void getSysInfo(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
 sys_info_end: 
     if(sysInfo.title)
@@ -398,7 +398,7 @@ void getSensorInfo(Webs *wp){
         websWrite(wp, pStr);
         websFlush(wp, 0);
         websDone(wp);
-        printf("cJSON:%s\n", pStr);
+        //printf("cJSON:%s\n", pStr);
 
         if(root)
             cJSON_Delete(root);
@@ -416,8 +416,8 @@ void buy(Webs *wp)
     char    *name, *age;
     name = websGetVar(wp, "name", NULL);
     age = websGetVar(wp, "age", NULL);
-    logmsg(2, "name value is : %s", name );
-     logmsg(2, "age value is : %s", age );
+    printf( "name value is : %s", name );
+     printf( "age value is : %s", age );
     websSetStatus(wp, 200);
     websWriteHeaders(wp, -1, 0);
     websWriteEndHeaders(wp);

+ 2 - 2
app/goahead-3.6.5/src/web_interface/src/fan.c

@@ -78,7 +78,7 @@ void getAllFanInfo(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -150,7 +150,7 @@ void setFanInfo(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);

+ 3 - 3
app/goahead-3.6.5/src/web_interface/src/fru.c

@@ -178,7 +178,7 @@ void getFruChassisInfo(Webs *wp)
     websWrite(wp, "%s", pStr); 
     websFlush(wp, 0);	//wait for all data to be written to the socket 
     websDone(wp);
-    printf("cJSON: %s\n", pStr);
+    //printf("cJSON: %s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -317,7 +317,7 @@ void getFruBoardInfo(Webs *wp)
     websWrite(wp, "%s", pStr);     
     websFlush(wp, 0);	//wait for all data to be written to the socket 
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -455,7 +455,7 @@ void getFruProductInfo(Webs *wp)
     websWrite(wp, "%s", pStr); 
     websFlush(wp, 0);	
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);

+ 6 - 6
app/goahead-3.6.5/src/web_interface/src/fw_update.c

@@ -59,7 +59,7 @@ void prepareDevice(Webs *wp)
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
  
     if(pStr)
         wfree(pStr);
@@ -114,7 +114,7 @@ void uploadFirmware(Webs *wp)
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:\n%s\n", pStr);
+    //printf("cJSON:\n%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -161,7 +161,7 @@ void updateFlash(Webs *wp)
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -221,7 +221,7 @@ void getUpdateProgress(Webs *wp)
     websWrite(wp, "%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
     
     if(pStr)
         wfree(pStr);
@@ -283,7 +283,7 @@ void getEraseStatus(Webs *wp)
     websWrite(wp, "%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -352,7 +352,7 @@ void getVerifyStatus(Webs *wp)
     websWrite(wp, "%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);

+ 2 - 2
app/goahead-3.6.5/src/web_interface/src/remote_control.c

@@ -91,7 +91,7 @@ void chassisPwrCtrl(Webs *wp){
     websWrite(wp, "%s", pStr);
     websFlush(wp, 0);	
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -134,5 +134,5 @@ void getChassisStatus(Webs *wp)
     websWrite(wp, "%s", ptr);
     websFlush(wp, 0);	
     websDone(wp);
-    printf("---> cJson:%s\n", ptr);
+    //printf("---> cJson:%s\n", ptr);
 }

+ 59 - 68
app/goahead-3.6.5/src/web_interface/src/sel.c

@@ -22,7 +22,6 @@ void Web_ClearSEL(Webs *wp)
     //Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
 
-//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -57,7 +56,6 @@ void Web_ClearSEL(Webs *wp)
     websWrite(wp, "%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -101,10 +99,14 @@ void GetAllSELEntriesSorted(Webs *wp)
         senNumNameTab[i].sensor_name[0] = '\0';
     }
 
+    websSetStatus(wp, 200);
+    websWriteHeaders(wp, -1, 0);
+    websWriteEndHeaders(wp); 
+    websWrite(wp, "{\"data\":[");
+
     //Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
 
-//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -123,26 +125,25 @@ void GetAllSELEntriesSorted(Webs *wp)
     }
     else
     {
-        //printf("---> nEntries %d\n", nEntries);
         if(nEntries > MAX_SEL_RECORD)   nEntries = MAX_SEL_RECORD;  //最大只能显示这么多日志
         if(nEntries == 0)
         {
             cJSON_AddItemToObject(root, "data", pJsonArry);
 
-            char *pStr;
-            pStr = cJSON_PrintUnformatted(root);
-            websSetStatus(wp, 200);
-            websWriteHeaders(wp, -1, 0);
-            websWriteEndHeaders(wp); 
-            websWrite(wp, pStr);
+            // char *pStr;
+            // pStr = cJSON_PrintUnformatted(root);
+            // websSetStatus(wp, 200);
+            // websWriteHeaders(wp, -1, 0);
+            // websWriteEndHeaders(wp); 
+            // websWrite(wp, pStr);
+            websWrite(wp, "]}");
             websFlush(wp, 0);
             websDone(wp);
-            printf("cJSON:%s\n", pStr);
             
-            if(root)
-                cJSON_Delete(root);
-            if(pStr)
-                wfree(pStr);
+            // if(root)
+            //     cJSON_Delete(root);
+            // if(pStr)
+            //     wfree(pStr);
 
             return;
         }
@@ -170,6 +171,10 @@ void GetAllSELEntriesSorted(Webs *wp)
             RecID = 0;  //first record
             for(i=0;i<nEntries;i++)
             {
+                if(i!=0)
+                {
+                    websWrite(wp, ",");
+                }
                 //获取日志
                 GetSelReq.ReservationID = ReserveID;
                 GetSelReq.RecID = RecID;
@@ -187,31 +192,24 @@ void GetAllSELEntriesSorted(Webs *wp)
                 {
                     break;
                 }
-                cJSON_AddItemToArray(pJsonArry,pJsonsub=cJSON_CreateObject()); /* 给创建的数组增加对对象*/
-                cJSON_AddNumberToObject(pJsonsub, "D1", SELEventData.hdr.ID);    //RecordID      -> D1
-                cJSON_AddNumberToObject(pJsonsub, "D2", SELEventData.hdr.Type);  //RecordType    -> D2
-                cJSON_AddNumberToObject(pJsonsub, "D3", SELEventData.hdr.TimeStamp); //TimeStamp -> D3
-                cJSON_AddNumberToObject(pJsonsub, "D4", SELEventData.GenID[0]);      //GenID1    -> D4
-                cJSON_AddNumberToObject(pJsonsub, "D5", SELEventData.GenID[1]);      //GenID2    -> D5
-                cJSON_AddNumberToObject(pJsonsub, "D6", SELEventData.EvMRev);        //EvmRev    -> D6
-                cJSON_AddNumberToObject(pJsonsub, "D7", SELEventData.SensorType);    //SensorType    -> D7
-                cJSON_AddNumberToObject(pJsonsub, "D8", SELEventData.EvtDirType);    //EventDirType  -> D8
-                cJSON_AddNumberToObject(pJsonsub, "D9", SELEventData.EvtData1);      //EventData1    -> D9
-                cJSON_AddNumberToObject(pJsonsub, "D10", SELEventData.EvtData2);     //EventData2    -> D10
-                cJSON_AddNumberToObject(pJsonsub, "D11", SELEventData.EvtData3);     //EventData3    -> D11
-                
-                // cJSON_AddNumberToObject(pJsonsub, "RecordID", SELEventData.hdr.ID);
-                // cJSON_AddNumberToObject(pJsonsub, "RecordType", SELEventData.hdr.Type);
-                // cJSON_AddNumberToObject(pJsonsub, "TimeStamp", SELEventData.hdr.TimeStamp);
-                // cJSON_AddNumberToObject(pJsonsub, "GenID1", SELEventData.GenID[0]);
-                // cJSON_AddNumberToObject(pJsonsub, "GenID2", SELEventData.GenID[1]);
-                // cJSON_AddNumberToObject(pJsonsub, "EvmRev", SELEventData.EvMRev);
-                // cJSON_AddNumberToObject(pJsonsub, "SensorType", SELEventData.SensorType);
-                // cJSON_AddNumberToObject(pJsonsub, "EventDirType", SELEventData.EvtDirType);
-                // cJSON_AddNumberToObject(pJsonsub, "EventData1", SELEventData.EvtData1);
-                // cJSON_AddNumberToObject(pJsonsub, "EventData2", SELEventData.EvtData2);
-                // cJSON_AddNumberToObject(pJsonsub, "EventData3", SELEventData.EvtData3);
-
+                // cJSON_AddItemToArray(pJsonArry,pJsonsub=cJSON_CreateObject()); /* 给创建的数组增加对对象*/
+                // cJSON_AddNumberToObject(pJsonsub, "D1", SELEventData.hdr.ID);    //RecordID      -> D1
+                // cJSON_AddNumberToObject(pJsonsub, "D2", SELEventData.hdr.Type);  //RecordType    -> D2
+                // cJSON_AddNumberToObject(pJsonsub, "D3", SELEventData.hdr.TimeStamp); //TimeStamp -> D3
+                // cJSON_AddNumberToObject(pJsonsub, "D4", SELEventData.GenID[0]);      //GenID1    -> D4
+                // cJSON_AddNumberToObject(pJsonsub, "D5", SELEventData.GenID[1]);      //GenID2    -> D5
+                // cJSON_AddNumberToObject(pJsonsub, "D6", SELEventData.EvMRev);        //EvmRev    -> D6
+                // cJSON_AddNumberToObject(pJsonsub, "D7", SELEventData.SensorType);    //SensorType    -> D7
+                // cJSON_AddNumberToObject(pJsonsub, "D8", SELEventData.EvtDirType);    //EventDirType  -> D8
+                // cJSON_AddNumberToObject(pJsonsub, "D9", SELEventData.EvtData1);      //EventData1    -> D9
+                // cJSON_AddNumberToObject(pJsonsub, "D10", SELEventData.EvtData2);     //EventData2    -> D10
+                // cJSON_AddNumberToObject(pJsonsub, "D11", SELEventData.EvtData3);     //EventData3    -> D11
+
+                websWrite(wp, "{\"D1\":%d,\"D2\":%d,\"D3\":%d,\"D4\":%d,\"D5\":%d,\"D6\":%d,\"D7\":%d,\"D8\":%d,\"D9\":%d,\"D10\":%d,\"D11\":%d,",
+                    SELEventData.hdr.ID, SELEventData.hdr.Type, SELEventData.hdr.TimeStamp, SELEventData.GenID[0],
+                    SELEventData.GenID[1], SELEventData.EvMRev, SELEventData.SensorType, SELEventData.EvtDirType,
+                    SELEventData.EvtData1, SELEventData.EvtData2, SELEventData.EvtData3);
+                            
                 //获取传感器名称
                 //printf("sensor number %d\n", SELEventData.SensorNum);
                 if((SELEventData.SensorNum != 0xff) && (SELEventData.hdr.Type == 0x02))
@@ -223,9 +221,9 @@ void GetAllSELEntriesSorted(Webs *wp)
                             break;
 
                         if(senNumNameTab[i].sensor_number == SELEventData.SensorNum)
-                        {                        
-                            //cJSON_AddStringToObject(pJsonsub, "c", senNumNameTab[i].sensor_name);
-                            cJSON_AddStringToObject(pJsonsub, "D12", senNumNameTab[i].sensor_name);  //SensorName -> D12
+                        {                                                
+                            //cJSON_AddStringToObject(pJsonsub, "D12", senNumNameTab[i].sensor_name);  //SensorName -> D12
+                            websWrite(wp, "\"D12\":\"%s\"}", senNumNameTab[i].sensor_name);
                             found_flag = 1;
                             break;
                         }
@@ -242,8 +240,8 @@ void GetAllSELEntriesSorted(Webs *wp)
                         {
                             wRet = IPMC_GetSensorName(&UDSSession, target_addr,SELEventData.SensorNum, sensorName, DEFAULT_TIMEOUT);
                         }
-                        //cJSON_AddStringToObject(pJsonsub, "c", sensorName);
-                        cJSON_AddStringToObject(pJsonsub, "D12", senNumNameTab[i].sensor_name);     //SensorName->D12
+                        //cJSON_AddStringToObject(pJsonsub, "D12", senNumNameTab[i].sensor_name);     //SensorName->D12
+                        websWrite(wp, "\"D12\":\"%s\"}", senNumNameTab[i].sensor_name);
                         if(wRet == 0)
                         {
                             //将得到的传感器名称保存到缓存中
@@ -251,7 +249,6 @@ void GetAllSELEntriesSorted(Webs *wp)
                             {
                                 if(senNumNameTab[i].sensor_number == 0xff)
                                 {
-                                    //printf("---> keep sensor name\n");
                                     senNumNameTab[i].sensor_number = SELEventData.SensorNum;
                                     strcpy(senNumNameTab[i].sensor_name, sensorName);                                
                                     break;
@@ -262,13 +259,14 @@ void GetAllSELEntriesSorted(Webs *wp)
                 }
                 else
                 {
-                    cJSON_AddStringToObject(pJsonsub, "D12", "--"); //SensorName -> D12
+                    //cJSON_AddStringToObject(pJsonsub, "D12", "--"); //SensorName -> D12
+                    websWrite(wp, "\"D12\":\"%s\"}", senNumNameTab[i].sensor_name);
                 }
 
                 if(RecID == 0xffff) //last record
                     break;
 
-                usleep(1);
+                //usleep(1);
             }
         }
     }
@@ -276,22 +274,17 @@ void GetAllSELEntriesSorted(Webs *wp)
     //Close session
     LIBIPMI_CloseSession(&UDSSession );
 
-    cJSON_AddItemToObject(root, "data", pJsonArry);
+    //cJSON_AddItemToObject(root, "data", pJsonArry);
 
-    char *pStr;
-    pStr = cJSON_PrintUnformatted(root);
-    websSetStatus(wp, 200);
-    websWriteHeaders(wp, -1, 0);
-    websWriteEndHeaders(wp); 
-    websWrite(wp, pStr);
+    websWrite(wp, "]}");
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n",pStr);
+    //printf("cJSON:%s\n",pStr);
     
-    if(root)
-        cJSON_Delete(root);
-    if(pStr)
-        wfree(pStr);
+    // if(root)
+    //     cJSON_Delete(root);
+    // if(pStr)
+    //     wfree(pStr);
     if(pSELBuff)
         wfree(pSELBuff);
 
@@ -301,10 +294,10 @@ error_out:
     //Close session
     LIBIPMI_CloseSession(&UDSSession );
     websError(wp, 404, "Get SEL error!");
-    if(root)
-        cJSON_Delete(root);
-    if(pStr)
-        wfree(pStr);
+    // if(root)
+    //     cJSON_Delete(root);
+    // if(pStr)
+    //     wfree(pStr);
     if(pSELBuff)
         wfree(pSELBuff);
 
@@ -331,7 +324,6 @@ void SetTime(Webs *wp)
     //Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
     
-//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -382,7 +374,7 @@ void SetTime(Webs *wp)
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -403,7 +395,6 @@ void GetTime(Webs *wp)
     //Create session
     LIBIPMI_CreateSession(&UDSSession, DEFAULT_TIMEOUT);
 
-//    wp->index = TEST_INDEX;
     target_addr = gIPMBAddr[wp->index];
     if(target_addr == 0x20)
     {
@@ -456,7 +447,7 @@ void GetTime(Webs *wp)
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);

+ 2 - 2
app/goahead-3.6.5/src/web_interface/src/server_health.c

@@ -112,7 +112,7 @@ void setThreshold(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -272,7 +272,7 @@ void webGetSensorHistory(Webs *wp)
     websWrite(wp, "%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);

+ 6 - 6
app/goahead-3.6.5/src/web_interface/src/user.c

@@ -71,7 +71,7 @@ void getAllUserInfo(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -117,7 +117,7 @@ void setUserPassword(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -193,7 +193,7 @@ void addUser(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -239,7 +239,7 @@ void delUser(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -266,7 +266,7 @@ void checkLoginStatus(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);
@@ -293,7 +293,7 @@ void logout(Webs *wp){
     websWrite(wp,"%s", pStr);
     websFlush(wp, 0);
     websDone(wp);
-    printf("cJSON:%s\n", pStr);
+    //printf("cJSON:%s\n", pStr);
 
     if(pStr)
         wfree(pStr);