diff --git a/src/plugins/http/src/gcHandle.c b/src/plugins/http/src/gcHandle.c
index 4980c9c804159053f9e9e4ad7484d2c3f2ba65a5..fbe6757ccbcdea09bce8d8feabfae95e2691a549 100644
--- a/src/plugins/http/src/gcHandle.c
+++ b/src/plugins/http/src/gcHandle.c
@@ -13,11 +13,13 @@
* along with this program. If not, see .
*/
-#include "gcHandle.h"
+#define _DEFAULT_SOURCE
+#include "os.h"
#include "cJSON.h"
+#include "httpLog.h"
+#include "gcHandle.h"
#include "gcJson.h"
#include "taosdef.h"
-#include "httpLog.h"
static HttpDecodeMethod gcDecodeMethod = {"grafana", gcProcessRequest};
static HttpEncodeMethod gcHeartBeatMethod = {NULL, gcSendHeartBeatResp, NULL, NULL, NULL, NULL, NULL, NULL};
diff --git a/src/plugins/http/src/gcJson.c b/src/plugins/http/src/gcJson.c
index 8f596337146a3937df72287f332917b3bffa21ac..09990c123e6b3c0716bc38252689fbfa1ae46394 100644
--- a/src/plugins/http/src/gcJson.c
+++ b/src/plugins/http/src/gcJson.c
@@ -13,10 +13,8 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-
+#define _DEFAULT_SOURCE
+#include "os.h"
#include "gcHandle.h"
#include "gcJson.h"
#include "httpJson.h"
diff --git a/src/plugins/http/src/httpAuth.c b/src/plugins/http/src/httpAuth.c
index adbf980f972c0160b2087cfbd25c6ecc8f083539..594f51e275a6db6ecd21307c0e24808656ed779b 100644
--- a/src/plugins/http/src/httpAuth.c
+++ b/src/plugins/http/src/httpAuth.c
@@ -13,12 +13,14 @@
* along with this program. If not, see .
*/
+#define _DEFAULT_SOURCE
#include "os.h"
+#include "tkey.h"
#include "tutil.h"
#include "http.h"
#include "httpLog.h"
#include "httpHandle.h"
-#include "tkey.h"
+
#define KEY_DES_4 4971256377704625728L
bool httpParseBasicAuthToken(HttpContext *pContext, char *token, int len) {
diff --git a/src/plugins/http/src/httpCode.c b/src/plugins/http/src/httpCode.c
index 230c0de2e09046eb9384817498b13adea4ddb42c..9ec07fd8511a5a240ff4cc7faa7d7b19e2081073 100644
--- a/src/plugins/http/src/httpCode.c
+++ b/src/plugins/http/src/httpCode.c
@@ -13,6 +13,9 @@
* along with this program. If not, see .
*/
+#define _DEFAULT_SOURCE
+
+
char* httpMsg[] = {
"success", // 0
"http server is not online", // 1
diff --git a/src/plugins/http/src/httpHandle.c b/src/plugins/http/src/httpHandle.c
index 529714c8e69dc18797114b5a8963f3ebff687e79..4eaff3660a87f373cc23d278c65caa8f718aab2b 100644
--- a/src/plugins/http/src/httpHandle.c
+++ b/src/plugins/http/src/httpHandle.c
@@ -13,21 +13,18 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-#include
-
-#include "http.h"
-#include "httpCode.h"
-#include "httpHandle.h"
-#include "httpResp.h"
-#include "shash.h"
+#define _DEFAULT_SOURCE
+#include "os.h"
#include "taos.h"
#include "tglobal.h"
#include "tsocket.h"
#include "ttimer.h"
+#include "shash.h"
+#include "http.h"
#include "httpLog.h"
+#include "httpCode.h"
+#include "httpHandle.h"
+#include "httpResp.h"
void httpToLowerUrl(char* url) {
/*ignore case */
diff --git a/src/plugins/http/src/httpJson.c b/src/plugins/http/src/httpJson.c
index fa74f857b37cd66c88d432894effdbcd33b399f0..cbca19b57f0b2875ec08688ba9bcfe09a36c9116 100644
--- a/src/plugins/http/src/httpJson.c
+++ b/src/plugins/http/src/httpJson.c
@@ -13,20 +13,15 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-#include
-#include
-#include
-
+#define _DEFAULT_SOURCE
+#include "os.h"
+#include "taosmsg.h"
+#include "taoserror.h"
#include "http.h"
+#include "httpLog.h"
#include "httpCode.h"
#include "httpJson.h"
#include "httpResp.h"
-#include "taosmsg.h"
-#include "httpLog.h"
-#include "taoserror.h"
#define MAX_NUM_STR_SZ 25
diff --git a/src/plugins/http/src/httpResp.c b/src/plugins/http/src/httpResp.c
index c0a5c6d7ea256d067925bb832f294cfb4d0031ae..b064b581164f3b7908c767dae8e6b8da0b96ff5e 100644
--- a/src/plugins/http/src/httpResp.c
+++ b/src/plugins/http/src/httpResp.c
@@ -13,14 +13,14 @@
* along with this program. If not, see .
*/
+#define _DEFAULT_SOURCE
+#include "os.h"
+#include "taoserror.h"
+#include "taosmsg.h"
+#include "httpLog.h"
#include "httpResp.h"
-#include
-#include
#include "httpCode.h"
#include "httpJson.h"
-#include "taosmsg.h"
-#include "httpLog.h"
-#include "taoserror.h"
const char *httpKeepAliveStr[] = {"", "Connection: Keep-Alive\r\n", "Connection: Close\r\n"};
diff --git a/src/plugins/http/src/httpServer.c b/src/plugins/http/src/httpServer.c
index f564863652f47fc48512379ac1759cbf83ff2a0d..f36e0440cb07c20db8894cd400fe4b60041f6452 100644
--- a/src/plugins/http/src/httpServer.c
+++ b/src/plugins/http/src/httpServer.c
@@ -13,6 +13,7 @@
* along with this program. If not, see .
*/
+#define _DEFAULT_SOURCE
#include "os.h"
#include "taosmsg.h"
#include "tsocket.h"
diff --git a/src/plugins/http/src/httpSession.c b/src/plugins/http/src/httpSession.c
index 39b2ff7d24a1b25dcdf58acacd4ed20b7295445d..4b095aeb774071e7595885104b144f2719d617ab 100644
--- a/src/plugins/http/src/httpSession.c
+++ b/src/plugins/http/src/httpSession.c
@@ -13,20 +13,18 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-
-#include "http.h"
-#include "httpCode.h"
-#include "httpHandle.h"
-#include "httpResp.h"
-
+#define _DEFAULT_SOURCE
+#include "os.h"
#include "shash.h"
#include "taos.h"
#include "ttime.h"
#include "ttimer.h"
+#include "http.h"
#include "httpLog.h"
+#include "httpCode.h"
+#include "httpHandle.h"
+#include "httpResp.h"
+
void httpAccessSession(HttpContext *pContext) {
HttpServer *server = pContext->pThread->pServer;
diff --git a/src/plugins/http/src/httpSql.c b/src/plugins/http/src/httpSql.c
index 017605093ee9dfe523a3757fa6d92d405f301d11..22ecdbc7b202190ee03c35d566d17709f1edf2fa 100644
--- a/src/plugins/http/src/httpSql.c
+++ b/src/plugins/http/src/httpSql.c
@@ -13,15 +13,16 @@
* along with this program. If not, see .
*/
+#define _DEFAULT_SOURCE
#include "os.h"
+#include "tnote.h"
+#include "taos.h"
+#include "tsclient.h"
#include "http.h"
+#include "httpLog.h"
#include "httpCode.h"
#include "httpHandle.h"
#include "httpResp.h"
-#include "taos.h"
-#include "tsclient.h"
-#include "tnote.h"
-#include "httpLog.h"
void *taos_connect_a(char *ip, char *user, char *pass, char *db, uint16_t port, void (*fp)(void *, TAOS_RES *, int),
void *param, void **taos);
diff --git a/src/plugins/http/src/httpSystem.c b/src/plugins/http/src/httpSystem.c
index 9afd5838c851dbfd49bef52d1732dcf98b962b09..355fdf2fd003f446b9ae66c1904f9946569d5e4e 100644
--- a/src/plugins/http/src/httpSystem.c
+++ b/src/plugins/http/src/httpSystem.c
@@ -15,17 +15,17 @@
#define _DEFAULT_SOURCE
#include "os.h"
+#include "shash.h"
+#include "taos.h"
+#include "tglobal.h"
+#include "tsocket.h"
+#include "ttimer.h"
#include "tadmin.h"
#include "http.h"
#include "httpCode.h"
#include "httpHandle.h"
#include "httpResp.h"
#include "httpLog.h"
-#include "shash.h"
-#include "taos.h"
-#include "tglobal.h"
-#include "tsocket.h"
-#include "ttimer.h"
#include "gcHandle.h"
#include "httpHandle.h"
#include "restHandle.h"
diff --git a/src/plugins/http/src/httpUtil.c b/src/plugins/http/src/httpUtil.c
index c8d4737c4175569ed6f3f0236406ee41c7d06c31..fc5f771c69d45f33e1c412b3a8e7852976151405 100644
--- a/src/plugins/http/src/httpUtil.c
+++ b/src/plugins/http/src/httpUtil.c
@@ -13,15 +13,16 @@
* along with this program. If not, see .
*/
+#define _DEFAULT_SOURCE
#include "os.h"
#include "tmd5.h"
+#include "shash.h"
+#include "taos.h"
#include "http.h"
+#include "httpLog.h"
#include "httpCode.h"
#include "httpHandle.h"
#include "httpResp.h"
-#include "shash.h"
-#include "taos.h"
-#include "httpLog.h"
bool httpCheckUsedbSql(char *sql) {
if (strstr(sql, "use ") != NULL) {
diff --git a/src/plugins/http/src/restHandle.c b/src/plugins/http/src/restHandle.c
index 79d6fe566222c6c629951729e86f85b9e44aa814..a2dc7d06a1a75fd51fa17f910599b67ea6129575 100644
--- a/src/plugins/http/src/restHandle.c
+++ b/src/plugins/http/src/restHandle.c
@@ -13,9 +13,11 @@
* along with this program. If not, see .
*/
+#define _DEFAULT_SOURCE
+#include "os.h"
+#include "httpLog.h"
#include "restHandle.h"
#include "restJson.h"
-#include "httpLog.h"
static HttpDecodeMethod restDecodeMethod = {"rest", restProcessRequest};
static HttpDecodeMethod restDecodeMethod2 = {"restful", restProcessRequest};
diff --git a/src/plugins/http/src/restJson.c b/src/plugins/http/src/restJson.c
index 0489bcdbe030eb15a828b0224f9153a13e77e6ba..9277d7d0456817188b24935a4cc9f396deb3283d 100644
--- a/src/plugins/http/src/restJson.c
+++ b/src/plugins/http/src/restJson.c
@@ -13,6 +13,7 @@
* along with this program. If not, see .
*/
+#define _DEFAULT_SOURCE
#include "os.h"
#include "tglobal.h"
#include "httpLog.h"
diff --git a/src/plugins/http/src/tgHandle.c b/src/plugins/http/src/tgHandle.c
index 5ea5f832d5a0d61fcefc1b75c6cd2b96c7cafc88..c854e0adc341303b5aafd27b2de2e03dafe817ed 100644
--- a/src/plugins/http/src/tgHandle.c
+++ b/src/plugins/http/src/tgHandle.c
@@ -13,14 +13,15 @@
* along with this program. If not, see .
*/
+#define _DEFAULT_SOURCE
#include "os.h"
-#include "tgHandle.h"
+#include "tglobal.h"
#include "shash.h"
+#include "taosdef.h"
#include "taosmsg.h"
+#include "tgHandle.h"
#include "tgJson.h"
-#include "taosdef.h"
#include "httpLog.h"
-#include "tglobal.h"
/*
* taos.telegraf.cfg formats like
diff --git a/src/plugins/http/src/tgJson.c b/src/plugins/http/src/tgJson.c
index f19e00fb9851529804403f6177ded8f212d0bf9b..1513d61d82b8579d6960fe2d3969a14c98ed94d9 100644
--- a/src/plugins/http/src/tgJson.c
+++ b/src/plugins/http/src/tgJson.c
@@ -13,13 +13,14 @@
* along with this program. If not, see .
*/
+#define _DEFAULT_SOURCE
#include "os.h"
+#include "taosmsg.h"
+#include "httpLog.h"
#include "httpJson.h"
#include "httpResp.h"
-#include "taosmsg.h"
#include "tgHandle.h"
#include "tgJson.h"
-#include "httpLog.h"
void tgInitQueryJson(HttpContext *pContext) {
JsonBuf *jsonBuf = httpMallocJsonBuf(pContext);