forked from boostorg/beast
fix #1108 The `flat_stream` is a stream wrapper designed to overcome a performance limitation of the `boost::asio::ssl::stream` implementation. Specifically, when writing buffer sequences having length greater than one, the `ssl::stream` implementation does not use scatter-gather I/O and instead performs a kernel transition for every buffer in the sequence. The wrapper addresses this problem by allocating memory and presenting the buffer sequence into a single buffer, using some logic to determine when this allocation is advantageous versus simply passing the buffers through as-is. See Also: https://github.com/boostorg/asio/issues/100 https://stackoverflow.com/questions/50026167/performance-drop-on-port-from-beast-1-0-0-b66-to-boost-1-67-0-beast