gw_buffer was not freed.

This commit is contained in:
vraatikka
2013-10-14 13:16:33 +03:00
parent 42417797a9
commit 0f2eeff243
3 changed files with 23 additions and 17 deletions

View File

@ -61,28 +61,27 @@ typedef struct {
* be copied within the gateway.
*/
typedef struct gwbuf {
struct gwbuf *next; /**< Next buffer in a linked chain of buffers */
void *start; /**< Start of the valid data */
void *end; /**< First byte after the valid data */
SHARED_BUF *sbuf; /**< The shared buffer with the real data */
int command; /**< The command type for the queue */
struct gwbuf *next; /**< Next buffer in a linked chain of buffers */
void *start; /**< Start of the valid data */
void *end; /**< First byte after the valid data */
SHARED_BUF *sbuf; /**< The shared buffer with the real data */
int command;/**< The command type for the queue */
} GWBUF;
/*
* Macros to access the data in the buffers
*/
#define GWBUF_DATA(b) ((b)->start) /**< First valid, uncomsumed
* byte in the buffer
*/
#define GWBUF_LENGTH(b) ((b)->end - (b)->start) /**< Number of bytes in the
* individual buffer
*/
#define GWBUF_EMPTY(b) ((b)->start == (b)->end) /**< True if all bytes in the
* buffer have been consumed
*/
#define GWBUF_CONSUME(b, bytes) (b)->start += bytes /**< Consume a number of bytes
* in the buffer
*/
/**< First valid, uncomsumed byte in the buffer */
#define GWBUF_DATA(b) ((b)->start)
/**< Number of bytes in the individual buffer */
#define GWBUF_LENGTH(b) ((b)->end - (b)->start)
/**< True if all bytes in the buffer have been consumed */
#define GWBUF_EMPTY(b) ((b)->start == (b)->end)
/**< Consume a number of bytes in the buffer */
#define GWBUF_CONSUME(b, bytes) (b)->start += bytes
/*
* Function prototypes for the API to maniplate the buffers