Fix KILL command packet boundary detection
If a packet with a KILL query was followed with another packet in the same network buffer, the code wouldn't work as it expected to receive only one packet at a time.
This commit is contained in:
@ -1863,13 +1863,8 @@ return_rc:
|
|||||||
static spec_com_res_t process_special_commands(DCB* dcb, GWBUF* read_buffer, int nbytes_read)
|
static spec_com_res_t process_special_commands(DCB* dcb, GWBUF* read_buffer, int nbytes_read)
|
||||||
{
|
{
|
||||||
spec_com_res_t rval = RES_CONTINUE;
|
spec_com_res_t rval = RES_CONTINUE;
|
||||||
bool is_complete = false;
|
unsigned int packet_len = MYSQL_GET_PAYLOAD_LEN((uint8_t*)GWBUF_DATA(read_buffer)) + MYSQL_HEADER_LEN;
|
||||||
unsigned int packet_len =
|
bool is_complete = gwbuf_length(read_buffer) >= packet_len;
|
||||||
MYSQL_GET_PAYLOAD_LEN((uint8_t*)GWBUF_DATA(read_buffer)) + MYSQL_HEADER_LEN;
|
|
||||||
if (gwbuf_length(read_buffer) == packet_len)
|
|
||||||
{
|
|
||||||
is_complete = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle COM_SET_OPTION. This seems to be only used by some versions of PHP.
|
* Handle COM_SET_OPTION. This seems to be only used by some versions of PHP.
|
||||||
|
Reference in New Issue
Block a user