mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 20:12:02 +00:00
Add setting http_max_uri_size
This commit is contained in:
parent
218542589a
commit
5cfeedb1e0
@ -227,6 +227,7 @@ class IColumn;
|
|||||||
M(Seconds, http_connection_timeout, DEFAULT_HTTP_READ_BUFFER_CONNECTION_TIMEOUT, "HTTP connection timeout.", 0) \
|
M(Seconds, http_connection_timeout, DEFAULT_HTTP_READ_BUFFER_CONNECTION_TIMEOUT, "HTTP connection timeout.", 0) \
|
||||||
M(Seconds, http_send_timeout, DEFAULT_HTTP_READ_BUFFER_TIMEOUT, "HTTP send timeout", 0) \
|
M(Seconds, http_send_timeout, DEFAULT_HTTP_READ_BUFFER_TIMEOUT, "HTTP send timeout", 0) \
|
||||||
M(Seconds, http_receive_timeout, DEFAULT_HTTP_READ_BUFFER_TIMEOUT, "HTTP receive timeout", 0) \
|
M(Seconds, http_receive_timeout, DEFAULT_HTTP_READ_BUFFER_TIMEOUT, "HTTP receive timeout", 0) \
|
||||||
|
M(UInt64, http_max_uri_size, 16384, "HTTP max URI length", 0) \
|
||||||
M(Bool, optimize_throw_if_noop, false, "If setting is enabled and OPTIMIZE query didn't actually assign a merge then an explanatory exception is thrown", 0) \
|
M(Bool, optimize_throw_if_noop, false, "If setting is enabled and OPTIMIZE query didn't actually assign a merge then an explanatory exception is thrown", 0) \
|
||||||
M(Bool, use_index_for_in_with_subqueries, true, "Try using an index if there is a subquery or a table expression on the right side of the IN operator.", 0) \
|
M(Bool, use_index_for_in_with_subqueries, true, "Try using an index if there is a subquery or a table expression on the right side of the IN operator.", 0) \
|
||||||
M(Bool, joined_subquery_requires_alias, true, "Force joined subqueries and table functions to have aliases for correct name qualification.", 0) \
|
M(Bool, joined_subquery_requires_alias, true, "Force joined subqueries and table functions to have aliases for correct name qualification.", 0) \
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
{
|
{
|
||||||
|
|
||||||
HTTPServerRequest::HTTPServerRequest(const Context & context, HTTPServerResponse & response, Poco::Net::HTTPServerSession & session)
|
HTTPServerRequest::HTTPServerRequest(const Context & context, HTTPServerResponse & response, Poco::Net::HTTPServerSession & session)
|
||||||
|
: max_uri_size(context.getSettingsRef().http_max_uri_size)
|
||||||
{
|
{
|
||||||
response.attachRequest(this);
|
response.attachRequest(this);
|
||||||
|
|
||||||
@ -93,10 +93,10 @@ void HTTPServerRequest::readRequest(ReadBuffer & in)
|
|||||||
|
|
||||||
skipWhitespaceIfAny(in);
|
skipWhitespaceIfAny(in);
|
||||||
|
|
||||||
while (in.read(ch) && !Poco::Ascii::isSpace(ch) && uri.size() <= MAX_URI_LENGTH)
|
while (in.read(ch) && !Poco::Ascii::isSpace(ch) && uri.size() <= max_uri_size)
|
||||||
uri += ch;
|
uri += ch;
|
||||||
|
|
||||||
if (uri.size() > MAX_URI_LENGTH)
|
if (uri.size() > max_uri_size)
|
||||||
throw Poco::Net::MessageException("HTTP request URI invalid or too long");
|
throw Poco::Net::MessageException("HTTP request URI invalid or too long");
|
||||||
|
|
||||||
skipWhitespaceIfAny(in);
|
skipWhitespaceIfAny(in);
|
||||||
|
@ -43,11 +43,12 @@ private:
|
|||||||
MAX_NAME_LENGTH = 256,
|
MAX_NAME_LENGTH = 256,
|
||||||
MAX_VALUE_LENGTH = 8192,
|
MAX_VALUE_LENGTH = 8192,
|
||||||
MAX_METHOD_LENGTH = 32,
|
MAX_METHOD_LENGTH = 32,
|
||||||
MAX_URI_LENGTH = 16384,
|
|
||||||
MAX_VERSION_LENGTH = 8,
|
MAX_VERSION_LENGTH = 8,
|
||||||
MAX_FIELDS_NUMBER = 100,
|
MAX_FIELDS_NUMBER = 100,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const size_t max_uri_size;
|
||||||
|
|
||||||
std::unique_ptr<ReadBuffer> stream;
|
std::unique_ptr<ReadBuffer> stream;
|
||||||
Poco::Net::SocketImpl * socket;
|
Poco::Net::SocketImpl * socket;
|
||||||
Poco::Net::SocketAddress client_address;
|
Poco::Net::SocketAddress client_address;
|
||||||
|
Loading…
Reference in New Issue
Block a user