diff --git a/include/maxscale/buffer.hh b/include/maxscale/buffer.hh index 587363b7d..8fa0feaca 100644 --- a/include/maxscale/buffer.hh +++ b/include/maxscale/buffer.hh @@ -423,9 +423,22 @@ public: * @see Buffer::operator = */ bool copy_from(const Buffer& rhs) + { + return copy_from(rhs.m_pBuffer); + } + + /** + * Clone a GWBUF and free the current buffer + * + * @param buf Buffer to clone + * + * @return True if buffer was copied + * + * @attention Invalidates all iterators. + */ + bool copy_from(GWBUF* pBuffer) { bool copied = true; - GWBUF* pBuffer = rhs.m_pBuffer; if (pBuffer) {