MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / send_next_part

Method send_next_part

boost-http/http.cpp:287–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285 }
286
287 void send_next_part() {
288 if (writing_) {
289 return;
290 }
291
292 if (!q_.empty()) {
293 writing_ = true;
294 auto buf = q_.front();
295
296 asio::async_write(
297 stream_, http::make_chunk(asio::buffer(*buf)),
298 asio::bind_executor(strand_, [self = shared_from_this(), buf](beast::error_code error, std::size_t) {
299 self->write_completed(std::move(error), WriteType::Chunk);
300 }));
301
302 return;
303 }
304
305 if (finished_) {
306 writing_ = true;
307
308 asio::async_write(stream_, http::make_chunk_last(),
309 asio::bind_executor(strand_, [self = shared_from_this()](beast::error_code error, std::size_t) {
310 self->write_completed(std::move(error), WriteType::Final);
311 }));
312 }
313 }
314
315 void close() {
316 beast::error_code error;

Callers

nothing calls this directly

Calls 1

write_completedMethod · 0.95

Tested by

no test coverage detected