提交 4aa90e90 编写于 作者: A Alexey Milovidov

Sending progress in HTTP headers (continued) [#CLICKHOUSE-32].

上级 c903a238
......@@ -55,6 +55,8 @@ private:
bool body_started_sending = false; /// If true, you could not add any headers.
Progress accumulated_progress;
std::mutex mutex; /// progress callback could be called from different threads.
......@@ -144,10 +146,12 @@ public:
/// Send all common headers before our special progress headers.
startSendHeaders();
accumulated_progress.incrementPiecewiseAtomically(progress);
std::string progress_string;
{
WriteBufferFromString progress_string_writer(progress_string);
progress.writeJSON(progress_string_writer);
accumulated_progress.writeJSON(progress_string_writer);
}
*response_header_ostr << "X-ClickHouse-Progress: " << progress_string << "\r\n" << std::flush;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册