MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / getRawBytesFromRequest

Function getRawBytesFromRequest

src/Server/KeeperHTTPStorageHandler.cpp:68–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68std::string getRawBytesFromRequest(HTTPServerRequest & request, const KeeperContextPtr & keeper_context)
69{
70 std::string request_data;
71 auto stream = request.getStream();
72
73 size_t max_request_size = keeper_context->getCoordinationSettings()[CoordinationSetting::max_request_size];
74 if (max_request_size > 0)
75 {
76 LimitReadBuffer limited_stream(*stream, LimitReadBuffer::Settings{
77 .read_no_more = max_request_size,
78 .expect_eof = false,
79 .excetion_hint = "request body is too large"});
80 readStringUntilEOF(request_data, limited_stream);
81 }
82 else
83 {
84 readStringUntilEOF(request_data, *stream);
85 }
86
87 return request_data;
88}
89
90bool setErrorResponseForZKCode(const Coordination::Error error, HTTPServerResponse & response)
91{

Callers 2

Calls 2

readStringUntilEOFFunction · 0.85
getStreamMethod · 0.45

Tested by

no test coverage detected