diff --git a/tdutils/td/utils/ByteFlow.h b/tdutils/td/utils/ByteFlow.h index 731b3110e..8526c22b0 100644 --- a/tdutils/td/utils/ByteFlow.h +++ b/tdutils/td/utils/ByteFlow.h @@ -45,7 +45,7 @@ class ByteFlowBaseCommon : public ByteFlowInterface { } void wakeup() final { - if (stop_flag_) { + if (stop_flag_ || !input_) { return; } input_->sync_with_writer(); diff --git a/test/http.cpp b/test/http.cpp index da5b6fc4a..bdcae2265 100644 --- a/test/http.cpp +++ b/test/http.cpp @@ -133,14 +133,14 @@ TEST(Http, reader) { clear_thread_locals(); SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR)); auto start_mem = BufferAllocator::get_buffer_mem(); - { + for (int i = 0; i < 20; i++) { td::ChainBufferWriter input_writer; auto input = input_writer.extract_reader(); HttpReader reader; int max_post_size = 10000; reader.init(&input, max_post_size, 0); - std::vector contents(1000); + std::vector contents(100); std::generate(contents.begin(), contents.end(), gen_http_content); auto v = td::transform(contents, rand_http_query); auto vec_str = rand_split(join(v));