Make a deep copy of queued queries

If a shallow copy of the buffer is made, any modifications that are made
to the data after it has been queued will affect the queued query of the
LocalClient.

A copy-on-write mechanism would save the relatively expensive process of
copying the data but since the LocalClient is not often used, it is not
the most critical performance problem.
This commit is contained in:
Markus Mäkelä 2017-12-26 21:12:34 +02:00
parent dfc7b1713a
commit 71d3009cd6

View File

@ -53,7 +53,7 @@ bool LocalClient::queue_query(GWBUF* buffer)
{
GWBUF* my_buf = NULL;
if (m_state != VC_ERROR && (my_buf = gwbuf_clone(buffer)))
if (m_state != VC_ERROR && (my_buf = gwbuf_deep_clone(buffer)))
{
m_queue.push_back(my_buf);