From c5d8c7b64c2b3dc6eefdb03497b6e475bde93a52 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 29 Aug 2019 10:55:47 -0700 Subject: [PATCH] Multiple I/O of the same type is not supported fix #1682 --- CHANGELOG.md | 1 + include/boost/beast/core/detail/stream_base.hpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9698a91..7f32bfaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Version 267: * basic_stream dtor cannot throw * cmake: check policy first * Add default dtors to satisfy -Wnon-virtual-dtor +* Multiple I/O of the same type is not supported -------------------------------------------------------------------------------- diff --git a/include/boost/beast/core/detail/stream_base.hpp b/include/boost/beast/core/detail/stream_base.hpp index 00591216..3f675d47 100644 --- a/include/boost/beast/core/detail/stream_base.hpp +++ b/include/boost/beast/core/detail/stream_base.hpp @@ -70,6 +70,13 @@ struct stream_base pending_guard(bool& b) : b_(b) { + // If this assert goes off, it means you are attempting + // to issue two of the same asynchronous I/O operation + // at the same time, without waiting for the first one + // to complete. For example, attempting two simultaneous + // calls to async_read_some. Only one pending call of + // each I/O type (read and write) is permitted. + // BOOST_ASSERT(! b_); b_ = true; }