Fix SSL regression

This builds on commit 1287b0e595a5f99026f66df7eeaef091b8ffc774 and cleans
up the original code. This fixes a bug introduced in the aforementioned
commit and cleans up the code.
This commit is contained in:
Markus Mäkelä
2017-11-08 10:00:10 +02:00
parent 1287b0e595
commit 4da28789ac
2 changed files with 20 additions and 4 deletions

View File

@ -335,6 +335,11 @@ static inline uint32_t MYSQL_GET_PAYLOAD_LEN(const uint8_t* header)
return gw_mysql_get_byte3(header);
}
static inline uint32_t MYSQL_GET_PACKET_LEN(const GWBUF* buffer)
{
return MYSQL_GET_PAYLOAD_LEN(GWBUF_DATA(buffer)) + MYSQL_HEADER_LEN;
}
#define MYSQL_GET_ERRCODE(payload) (gw_mysql_get_byte2(&payload[5]))
#define MYSQL_GET_STMTOK_NPARAM(payload) (gw_mysql_get_byte2(&payload[9]))
#define MYSQL_GET_STMTOK_NATTR(payload) (gw_mysql_get_byte2(&payload[11]))