Fix debug assertion on readq prepend
If data was prepended to the readq while it was empty, the debug assertion in gwbuf_append that checks the tail pointer would be hit.
This commit is contained in:
@ -342,7 +342,7 @@ static unsigned int dcb_readq_length(DCB* dcb)
|
|||||||
*/
|
*/
|
||||||
static inline void dcb_readq_prepend(DCB* dcb, GWBUF* buffer)
|
static inline void dcb_readq_prepend(DCB* dcb, GWBUF* buffer)
|
||||||
{
|
{
|
||||||
dcb->readq = gwbuf_append(buffer, dcb->readq);
|
dcb->readq = dcb->readq ? gwbuf_append(buffer, dcb->readq) : buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user