Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
3d860fc6
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
3d860fc6
编写于
4月 03, 2021
作者:
A
alexey-milovidov
提交者:
GitHub
4月 03, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22322 from abyss7/issue-21907
Do not limit HTTP chunk size
上级
c3a9cbe0
05917521
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
9 deletion
+22
-9
src/IO/HTTPChunkedReadBuffer.cpp
src/IO/HTTPChunkedReadBuffer.cpp
+0
-4
src/IO/HTTPChunkedReadBuffer.h
src/IO/HTTPChunkedReadBuffer.h
+1
-2
src/Server/HTTP/HTTPServerRequest.cpp
src/Server/HTTP/HTTPServerRequest.cpp
+1
-2
tests/queries/0_stateless/01783_http_chunk_size.reference
tests/queries/0_stateless/01783_http_chunk_size.reference
+1
-0
tests/queries/0_stateless/01783_http_chunk_size.sh
tests/queries/0_stateless/01783_http_chunk_size.sh
+17
-0
tests/queries/skip_list.json
tests/queries/skip_list.json
+2
-1
未找到文件。
src/IO/HTTPChunkedReadBuffer.cpp
浏览文件 @
3d860fc6
...
...
@@ -14,7 +14,6 @@ namespace ErrorCodes
extern
const
int
ARGUMENT_OUT_OF_BOUND
;
extern
const
int
UNEXPECTED_END_OF_FILE
;
extern
const
int
CORRUPTED_DATA
;
extern
const
int
TOO_MANY_BYTES
;
}
size_t
HTTPChunkedReadBuffer
::
readChunkHeader
()
...
...
@@ -40,9 +39,6 @@ size_t HTTPChunkedReadBuffer::readChunkHeader()
if
(
in
->
eof
())
throw
Exception
(
"Unexpected end of file while reading chunk header of HTTP chunked data"
,
ErrorCodes
::
UNEXPECTED_END_OF_FILE
);
if
(
res
>
max_size
)
throw
Exception
(
"Chunk size is too large"
,
ErrorCodes
::
TOO_MANY_BYTES
);
assertString
(
"
\n
"
,
*
in
);
return
res
;
}
...
...
src/IO/HTTPChunkedReadBuffer.h
浏览文件 @
3d860fc6
...
...
@@ -10,11 +10,10 @@ namespace DB
class
HTTPChunkedReadBuffer
:
public
BufferWithOwnMemory
<
ReadBuffer
>
{
public:
HTTPChunkedReadBuffer
(
std
::
unique_ptr
<
ReadBuffer
>
in_
,
size_t
max_chunk_size
)
:
in
(
std
::
move
(
in_
)),
max_size
(
max_chunk_size
)
{}
explicit
HTTPChunkedReadBuffer
(
std
::
unique_ptr
<
ReadBuffer
>
in_
)
:
in
(
std
::
move
(
in_
)
)
{}
private:
std
::
unique_ptr
<
ReadBuffer
>
in
;
const
size_t
max_size
;
size_t
readChunkHeader
();
void
readChunkFooter
();
...
...
src/Server/HTTP/HTTPServerRequest.cpp
浏览文件 @
3d860fc6
...
...
@@ -26,7 +26,6 @@ HTTPServerRequest::HTTPServerRequest(const Context & context, HTTPServerResponse
auto
receive_timeout
=
context
.
getSettingsRef
().
http_receive_timeout
;
auto
send_timeout
=
context
.
getSettingsRef
().
http_send_timeout
;
auto
max_query_size
=
context
.
getSettingsRef
().
max_query_size
;
session
.
socket
().
setReceiveTimeout
(
receive_timeout
);
session
.
socket
().
setSendTimeout
(
send_timeout
);
...
...
@@ -37,7 +36,7 @@ HTTPServerRequest::HTTPServerRequest(const Context & context, HTTPServerResponse
readRequest
(
*
in
);
/// Try parse according to RFC7230
if
(
getChunkedTransferEncoding
())
stream
=
std
::
make_unique
<
HTTPChunkedReadBuffer
>
(
std
::
move
(
in
)
,
max_query_size
);
stream
=
std
::
make_unique
<
HTTPChunkedReadBuffer
>
(
std
::
move
(
in
));
else
if
(
hasContentLength
())
stream
=
std
::
make_unique
<
LimitReadBuffer
>
(
std
::
move
(
in
),
getContentLength
(),
false
);
else
if
(
getMethod
()
!=
HTTPRequest
::
HTTP_GET
&&
getMethod
()
!=
HTTPRequest
::
HTTP_HEAD
&&
getMethod
()
!=
HTTPRequest
::
HTTP_DELETE
)
...
...
tests/queries/0_stateless/01783_http_chunk_size.reference
0 → 100644
浏览文件 @
3d860fc6
1234567890 1234567890 1234567890 1234567890
tests/queries/0_stateless/01783_http_chunk_size.sh
0 → 100755
浏览文件 @
3d860fc6
#!/usr/bin/env bash
CURDIR
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
# shellcheck source=../shell_config.sh
.
"
$CURDIR
"
/../shell_config.sh
URL
=
"
${
CLICKHOUSE_URL
}
&session_id=id_
${
CLICKHOUSE_DATABASE
}
"
echo
"DROP TABLE IF EXISTS table"
|
${
CLICKHOUSE_CURL
}
-sSg
"
${
URL
}
"
-d
@-
echo
"CREATE TABLE table (a String) ENGINE Memory()"
|
${
CLICKHOUSE_CURL
}
-sSg
"
${
URL
}
"
-d
@-
# NOTE: suppose that curl sends everything in a single chunk - there are no options to force the chunk-size.
echo
"SET max_query_size=44"
|
${
CLICKHOUSE_CURL
}
-sSg
"
${
URL
}
"
-d
@-
echo
-ne
"INSERT INTO TABLE table FORMAT TabSeparated 1234567890 1234567890 1234567890 1234567890
\n
"
|
${
CLICKHOUSE_CURL
}
-H
"Transfer-Encoding: chunked"
-sS
"
${
URL
}
"
--data-binary
@-
echo
"SELECT * from table"
|
${
CLICKHOUSE_CURL
}
-sSg
"
${
URL
}
"
-d
@-
echo
"DROP TABLE table"
|
${
CLICKHOUSE_CURL
}
-sSg
"
${
URL
}
"
-d
@-
tests/queries/skip_list.json
浏览文件 @
3d860fc6
...
...
@@ -164,7 +164,8 @@
"00062_replicated_merge_tree_alter_zookeeper"
,
///
Does
not
support
renaming
of
multiple
tables
in
single
query
"00634_rename_view"
,
"00140_rename"
"00140_rename"
,
"01783_http_chunk_size"
],
"polymorphic-parts"
:
[
"01508_partition_pruning_long"
,
///
bug
,
shoud
be
fixed
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录