]> git.ipfire.org Git - thirdparty/squid.git/commit
Maintenance: De-duplicate PackableStreamBuf and SBufStreamBuf (#959)
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 13 Jan 2022 22:38:24 +0000 (22:38 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 19 Jan 2022 20:53:39 +0000 (20:53 +0000)
commitf212d11018c298fd7a940dcecc7b4030ae790bc2
tree9c0253b02fff3f6c05941fa50f43d60318a6a947
parentdf0bc0f4ff158b76e6a05c64fc83b96219605b4a
Maintenance: De-duplicate PackableStreamBuf and SBufStreamBuf (#959)

SBufStreamBuf was almost identical to PackableStreamBuf. Both classes
are pass-through write-only streambufs that lack their own put area. Now
their common code lives in AppendingStreamBuf.

No functionality changes intended.

The removed std::streambuf method descriptions were imprecise and some
were misleading. STL documentation describes this standard/parent API.

While also similar, PackableStream and SBufStream have important
differences in API and implementation. For example, unlike
PackableStream, SBufStream owns the sink buffer and does not modify the
buffer it was created with, providing a safe content extraction method
instead. The two classes cannot be merged without changing their users,
and it may be impossible to justify SBufStream users exposure to the
dangers of forgetting to sync() the streambuf before accessing the sink.
src/base/PackableStream.h
src/sbuf/Stream.h