mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Sending progress in HTTP headers (continued) [#CLICKHOUSE-32].
This commit is contained in:
parent
c903a23864
commit
4aa90e908d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user