Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷面1992
TDengine
提交
0eb45e7a
TDengine
项目概览
冷面1992
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0eb45e7a
编写于
4月 24, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-19] refactor http module
上级
af305abd
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
62 addition
and
59 deletion
+62
-59
src/plugins/http/src/gcHandle.c
src/plugins/http/src/gcHandle.c
+4
-2
src/plugins/http/src/gcJson.c
src/plugins/http/src/gcJson.c
+2
-4
src/plugins/http/src/httpAuth.c
src/plugins/http/src/httpAuth.c
+3
-1
src/plugins/http/src/httpCode.c
src/plugins/http/src/httpCode.c
+3
-0
src/plugins/http/src/httpHandle.c
src/plugins/http/src/httpHandle.c
+7
-10
src/plugins/http/src/httpJson.c
src/plugins/http/src/httpJson.c
+5
-10
src/plugins/http/src/httpResp.c
src/plugins/http/src/httpResp.c
+5
-5
src/plugins/http/src/httpServer.c
src/plugins/http/src/httpServer.c
+1
-0
src/plugins/http/src/httpSession.c
src/plugins/http/src/httpSession.c
+7
-9
src/plugins/http/src/httpSql.c
src/plugins/http/src/httpSql.c
+5
-4
src/plugins/http/src/httpSystem.c
src/plugins/http/src/httpSystem.c
+5
-5
src/plugins/http/src/httpUtil.c
src/plugins/http/src/httpUtil.c
+4
-3
src/plugins/http/src/restHandle.c
src/plugins/http/src/restHandle.c
+3
-1
src/plugins/http/src/restJson.c
src/plugins/http/src/restJson.c
+1
-0
src/plugins/http/src/tgHandle.c
src/plugins/http/src/tgHandle.c
+4
-3
src/plugins/http/src/tgJson.c
src/plugins/http/src/tgJson.c
+3
-2
未找到文件。
src/plugins/http/src/gcHandle.c
浏览文件 @
0eb45e7a
...
...
@@ -13,11 +13,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
};
...
...
src/plugins/http/src/gcJson.c
浏览文件 @
0eb45e7a
...
...
@@ -13,10 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#define _DEFAULT_SOURCE
#include "os.h"
#include "gcHandle.h"
#include "gcJson.h"
#include "httpJson.h"
...
...
src/plugins/http/src/httpAuth.c
浏览文件 @
0eb45e7a
...
...
@@ -13,12 +13,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
)
{
...
...
src/plugins/http/src/httpCode.c
浏览文件 @
0eb45e7a
...
...
@@ -13,6 +13,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
char
*
httpMsg
[]
=
{
"success"
,
// 0
"http server is not online"
,
// 1
...
...
src/plugins/http/src/httpHandle.c
浏览文件 @
0eb45e7a
...
...
@@ -13,21 +13,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <arpa/inet.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#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 */
...
...
src/plugins/http/src/httpJson.c
浏览文件 @
0eb45e7a
...
...
@@ -13,20 +13,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#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
...
...
src/plugins/http/src/httpResp.c
浏览文件 @
0eb45e7a
...
...
@@ -13,14 +13,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "taoserror.h"
#include "taosmsg.h"
#include "httpLog.h"
#include "httpResp.h"
#include <stdio.h>
#include <string.h>
#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
"
};
...
...
src/plugins/http/src/httpServer.c
浏览文件 @
0eb45e7a
...
...
@@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "taosmsg.h"
#include "tsocket.h"
...
...
src/plugins/http/src/httpSession.c
浏览文件 @
0eb45e7a
...
...
@@ -13,20 +13,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include <time.h>
#include <unistd.h>
#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
;
...
...
src/plugins/http/src/httpSql.c
浏览文件 @
0eb45e7a
...
...
@@ -13,15 +13,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
);
...
...
src/plugins/http/src/httpSystem.c
浏览文件 @
0eb45e7a
...
...
@@ -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"
...
...
src/plugins/http/src/httpUtil.c
浏览文件 @
0eb45e7a
...
...
@@ -13,15 +13,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
)
{
...
...
src/plugins/http/src/restHandle.c
浏览文件 @
0eb45e7a
...
...
@@ -13,9 +13,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
};
...
...
src/plugins/http/src/restJson.c
浏览文件 @
0eb45e7a
...
...
@@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "tglobal.h"
#include "httpLog.h"
...
...
src/plugins/http/src/tgHandle.c
浏览文件 @
0eb45e7a
...
...
@@ -13,14 +13,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "tg
Handle
.h"
#include "tg
lobal
.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
...
...
src/plugins/http/src/tgJson.c
浏览文件 @
0eb45e7a
...
...
@@ -13,13 +13,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录