mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Sending progress in HTTP headers (continued) [#CLICKHOUSE-32].
This commit is contained in:
parent
b2457e076a
commit
3476e4d4c4
@ -67,7 +67,7 @@ public:
|
||||
/// Must not be called after beginSend(), sendFile(), sendBuffer()
|
||||
/// or redirect() has been called.
|
||||
|
||||
virtual void beginSend(std::ostream * out_header_stream, std::ostream * out_body_stream) = 0;
|
||||
virtual std::pair<std::ostream *, std::ostream *> beginSend() = 0;
|
||||
/// Sends the response headers to the client
|
||||
/// but do not finish headers with \r\n,
|
||||
/// allowing to continue sending additional header fields.
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
/// Must not be called after beginSend(), sendFile(), sendBuffer()
|
||||
/// or redirect() has been called.
|
||||
|
||||
void beginSend(std::ostream * out_header_stream, std::ostream * out_body_stream);
|
||||
std::pair<std::ostream *, std::ostream *> beginSend();
|
||||
/// Sends the response headers to the client
|
||||
/// but do not finish headers with \r\n,
|
||||
/// allowing to continue sending additional header fields.
|
||||
|
@ -111,7 +111,7 @@ std::ostream& HTTPServerResponseImpl::send()
|
||||
}
|
||||
|
||||
|
||||
void HTTPServerResponseImpl::beginSend(std::ostream * out_header_stream, std::ostream * out_body_stream)
|
||||
std::pair<std::ostream *, std::ostream *> HTTPServerResponseImpl::beginSend()
|
||||
{
|
||||
poco_assert (!_pStream);
|
||||
poco_assert (!_pHeaderStream);
|
||||
@ -141,8 +141,7 @@ void HTTPServerResponseImpl::beginSend(std::ostream * out_header_stream, std::os
|
||||
beginWrite(*_pStream);
|
||||
}
|
||||
|
||||
out_header_stream = _pHeaderStream;
|
||||
out_body_stream = _pStream;
|
||||
return std::make_pair(out_header_stream, out_body_stream);
|
||||
}
|
||||
|
||||
|
||||
|
@ -82,7 +82,7 @@ private:
|
||||
throw Exception("Logical error: unknown compression method passed to WriteBufferFromHTTPServerResponse",
|
||||
ErrorCodes::LOGICAL_ERROR);
|
||||
|
||||
response.beginSend(response_header_ostr, response_body_ostr);
|
||||
std::tie(response_header_ostr, response_body_ostr) = response.beginSend();
|
||||
out_raw.emplace(*response_body_ostr);
|
||||
/// Use memory allocated for the outer buffer in the buffer pointed to by out. This avoids extra allocation and copy.
|
||||
deflating_buf.emplace(out_raw.value(), compression_method, compression_level, working_buffer.size(), working_buffer.begin());
|
||||
@ -90,7 +90,7 @@ private:
|
||||
}
|
||||
else
|
||||
{
|
||||
response.beginSend(response_header_ostr, response_body_ostr);
|
||||
std::tie(response_header_ostr, response_body_ostr) = response.beginSend();
|
||||
out_raw.emplace(*response_body_ostr, working_buffer.size(), working_buffer.begin());
|
||||
out = &out_raw.value();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user