Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
TDengine
提交
515796fd
T
TDengine
项目概览
jobily
/
TDengine
9 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
515796fd
编写于
9月 05, 2023
作者:
W
wade zhang
提交者:
GitHub
9月 05, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22733 from taosdata/fix/TD-26135
fix(tdb): fix tdb coverity warning
上级
11b384d9
dd6a1161
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
4 deletion
+8
-4
source/dnode/vnode/src/vnd/vnodeCos.c
source/dnode/vnode/src/vnd/vnodeCos.c
+7
-4
source/libs/tdb/src/db/tdbBtree.c
source/libs/tdb/src/db/tdbBtree.c
+1
-0
未找到文件。
source/dnode/vnode/src/vnd/vnodeCos.c
浏览文件 @
515796fd
...
...
@@ -59,17 +59,19 @@ int32_t s3PutObjectFromFile(const char *file_str, const char *object_str) {
cos_request_options_t
*
options
=
NULL
;
cos_string_t
bucket
,
object
,
file
;
cos_table_t
*
resp_headers
;
int
traffic_limit
=
0
;
//
int traffic_limit = 0;
cos_pool_create
(
&
p
,
NULL
);
options
=
cos_request_options_create
(
p
);
s3InitRequestOptions
(
options
,
is_cname
);
cos_table_t
*
headers
=
NULL
;
/*
if (traffic_limit) {
// 限速值设置范围为819200 - 838860800,即100KB/s - 100MB/s,如果超出该范围将返回400错误
headers = cos_table_make(p, 1);
cos_table_add_int(headers, "x-cos-traffic-limit", 819200);
}
*/
cos_str_set
(
&
bucket
,
tsS3BucketName
);
cos_str_set
(
&
file
,
file_str
);
cos_str_set
(
&
object
,
object_str
);
...
...
@@ -185,7 +187,7 @@ bool s3Get(const char *object_name, const char *path) {
cos_string_t
file
;
cos_table_t
*
resp_headers
=
NULL
;
cos_table_t
*
headers
=
NULL
;
int
traffic_limit
=
0
;
//
int traffic_limit = 0;
//创建内存池
cos_pool_create
(
&
p
,
NULL
);
...
...
@@ -194,12 +196,13 @@ bool s3Get(const char *object_name, const char *path) {
options
=
cos_request_options_create
(
p
);
s3InitRequestOptions
(
options
,
is_cname
);
cos_str_set
(
&
bucket
,
tsS3BucketName
);
/*
if (traffic_limit) {
//限速值设置范围为819200 - 838860800,即100KB/s - 100MB/s,如果超出该范围将返回400错误
headers = cos_table_make(p, 1);
cos_table_add_int(headers, "x-cos-traffic-limit", 819200);
}
*/
//下载对象
cos_str_set
(
&
file
,
path
);
cos_str_set
(
&
object
,
object_name
);
...
...
@@ -278,7 +281,7 @@ void s3EvictCache(const char *path, long object_size) {
size_t
ef_size
=
TARRAY_SIZE
(
evict_files
);
for
(
size_t
i
=
0
;
i
<
ef_size
;
++
i
)
{
SEvictFile
*
evict_file
=
taosArrayGet
(
evict_files
,
i
);
taosRemoveFile
(
evict_file
->
name
);
(
void
)
taosRemoveFile
(
evict_file
->
name
);
evict_size
+=
evict_file
->
size
;
if
(
evict_size
>=
object_size
)
{
break
;
...
...
source/libs/tdb/src/db/tdbBtree.c
浏览文件 @
515796fd
...
...
@@ -1070,6 +1070,7 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const
// pack partial val to local if any space left
if
(
nLocal
>
nHeader
+
kLen
+
sizeof
(
SPgno
))
{
if
(
ASSERT
(
pVal
!=
NULL
&&
vLen
!=
0
))
{
tdbFree
(
pBuf
);
return
-
1
;
}
memcpy
(
pCell
+
nHeader
+
kLen
,
pVal
,
nLocal
-
nHeader
-
kLen
-
sizeof
(
SPgno
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录