From f8a9209f5b0516cc46bcd84983e72ab406a925da Mon Sep 17 00:00:00 2001 From: huangxin Date: Wed, 22 Feb 2023 15:58:22 +0800 Subject: [PATCH] =?UTF-8?q?OCT=201.=20=E4=BF=AE=E6=AD=A3=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=BF=94=E5=9B=9E2=E6=AC=A1=E6=95=B0=E6=8D=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srcs/libs/network/http_svr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/srcs/libs/network/http_svr.c b/srcs/libs/network/http_svr.c index 73e7044..e54786f 100644 --- a/srcs/libs/network/http_svr.c +++ b/srcs/libs/network/http_svr.c @@ -45,7 +45,7 @@ static void rsp_err_msg(struct mg_connection *c, int httpCode, int errCode) { mg_http_reply(c, httpCode, "Content-Type: application/json\r\n", "%s\n", pStrPro ? pStrPro : ""); - LOG_MOD(trace, ZLOG_MOD_HTTPD, "Response(%d): %s\n", httpCode, pStrPro); + LOG_MOD(info, ZLOG_MOD_HTTPD, "Response(%d): %s\n", httpCode, pStrPro); if (pStrPro) { free((void *)pStrPro); @@ -67,11 +67,7 @@ static void on_mg_event_cb(struct mg_connection *c, int ev, void *ev_data, void pItem->pCallbackHandler(hm, pItem->pUserData, pCtx); if (pCtx->errCode == ERR_SUCCESS && pCtx->pRspData) { mg_http_reply(c, pCtx->httpCode, pCtx->pRspHeads, "%s\n", pCtx->pRspData); - LOG_MOD(trace, - ZLOG_MOD_HTTPD, - "Response:(%d) %s\n", - pCtx->httpCode, - (char *)pCtx->pRspData); + LOG_MOD(info, ZLOG_MOD_HTTPD, "Response:(%d) %s\n", pCtx->httpCode, (char *)pCtx->pRspData); } else { rsp_err_msg(c, pCtx->httpCode, pCtx->errCode); } @@ -86,6 +82,8 @@ static void on_mg_event_cb(struct mg_connection *c, int ev, void *ev_data, void } else { rsp_err_msg(c, 405, ERR_HTTP_UNSUP_METHOD); } + + matched = TRUE; } }