Skip to content

Commit 4f540b1

Browse files
committed
docs: update a comment to be clearer
1 parent 577746a commit 4f540b1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

libs/server-sent-events/src/curl_client.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,11 @@ class CurlClient final : public Client,
9494
std::chrono::steady_clock::time_point last_progress_time;
9595
curl_off_t last_download_amount;
9696

97-
// These are thread-safe, because they are only accessed from
98-
// CurlClient's strand after construction.
97+
// Mutated on the strand in do_run() before each transfer, and read by
98+
// libcurl via raw pointers (CURLOPT_URL, CURLOPT_POSTFIELDS) for the
99+
// duration of the transfer. Safe because the next do_run() only fires
100+
// after the previous transfer's completion callback, so reads and
101+
// writes never overlap.
99102
http::request<http::string_body> req;
100103
std::string url;
101104
std::optional<std::chrono::milliseconds> const connect_timeout;

0 commit comments

Comments
 (0)