fix getting a buffer in case a pool is not available
This commit is contained in:
parent
57d785bd7c
commit
2b78e09db2
|
@ -43,7 +43,10 @@ namespace detail {
|
|||
/// messages sent through the stream are big and have (approximately) the
|
||||
/// same size.
|
||||
Buffer MakeBuffer() {
|
||||
if (_shared_state)
|
||||
return _shared_state->MakeBuffer();
|
||||
else
|
||||
return Buffer();
|
||||
}
|
||||
|
||||
/// Flush @a buffers down the stream. No copies are made.
|
||||
|
|
|
@ -19,7 +19,10 @@ namespace detail {
|
|||
StreamStateBase::~StreamStateBase() = default;
|
||||
|
||||
Buffer StreamStateBase::MakeBuffer() {
|
||||
if (_buffer_pool)
|
||||
return _buffer_pool->Pop();
|
||||
else
|
||||
return Buffer();
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
|
Loading…
Reference in New Issue