Masking: Use common constants
- Response related constants moved from ComPacket to ComResponse - Constants defined using defines from .../maxscale/protocol/mysql.h
This commit is contained in:
@ -126,9 +126,9 @@ void MaskingFilterSession::handle_response(GWBUF* pPacket)
|
|||||||
|
|
||||||
switch (response.type())
|
switch (response.type())
|
||||||
{
|
{
|
||||||
case ComPacket::OK_PACKET: // OK
|
case ComResponse::OK_PACKET:
|
||||||
// We'll end up here also in the case of a multi-result.
|
// We'll end up here also in the case of a multi-result.
|
||||||
case 0xfb: // GET_MORE_CLIENT_DATA/SEND_MORE_CLIENT_DATA
|
case ComResponse::LOCAL_INFILE_PACKET: // GET_MORE_CLIENT_DATA/SEND_MORE_CLIENT_DATA
|
||||||
m_state = EXPECTING_NOTHING;
|
m_state = EXPECTING_NOTHING;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ void MaskingFilterSession::handle_row(GWBUF* pPacket)
|
|||||||
ComPacket response(pPacket);
|
ComPacket response(pPacket);
|
||||||
|
|
||||||
if ((response.payload_len() == ComEOF::PAYLOAD_LEN) &&
|
if ((response.payload_len() == ComEOF::PAYLOAD_LEN) &&
|
||||||
(ComResponse(response).type() == ComPacket::EOF_PACKET))
|
(ComResponse(response).type() == ComResponse::EOF_PACKET))
|
||||||
{
|
{
|
||||||
// EOF after last row.
|
// EOF after last row.
|
||||||
ComEOF eof(response);
|
ComEOF eof(response);
|
||||||
|
@ -481,13 +481,6 @@ inline LEncString::iterator operator - (const LEncString::iterator& it, ptrdiff_
|
|||||||
class ComPacket
|
class ComPacket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum
|
|
||||||
{
|
|
||||||
OK_PACKET = 0x00,
|
|
||||||
EOF_PACKET = 0xfe,
|
|
||||||
ERR_PACKET = 0xff,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
MAX_PAYLOAD_LEN = 0xffffff
|
MAX_PAYLOAD_LEN = 0xffffff
|
||||||
@ -544,6 +537,14 @@ private:
|
|||||||
class ComResponse : public ComPacket
|
class ComResponse : public ComPacket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
OK_PACKET = MYSQL_REPLY_OK, // 0x00
|
||||||
|
EOF_PACKET = MYSQL_REPLY_EOF, // 0xfe
|
||||||
|
ERR_PACKET = MYSQL_REPLY_ERR, // 0xff
|
||||||
|
LOCAL_INFILE_PACKET = MYSQL_REPLY_LOCAL_INFILE // 0xfb
|
||||||
|
};
|
||||||
|
|
||||||
ComResponse(GWBUF* pPacket)
|
ComResponse(GWBUF* pPacket)
|
||||||
: ComPacket(pPacket)
|
: ComPacket(pPacket)
|
||||||
, m_type(*m_pData)
|
, m_type(*m_pData)
|
||||||
@ -574,17 +575,17 @@ public:
|
|||||||
|
|
||||||
bool is_ok() const
|
bool is_ok() const
|
||||||
{
|
{
|
||||||
return m_type == ComPacket::OK_PACKET;
|
return m_type == ComResponse::OK_PACKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_eof() const
|
bool is_eof() const
|
||||||
{
|
{
|
||||||
return m_type == ComPacket::EOF_PACKET;
|
return m_type == ComResponse::EOF_PACKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_err() const
|
bool is_err() const
|
||||||
{
|
{
|
||||||
return m_type == ComPacket::ERR_PACKET;
|
return m_type == ComResponse::ERR_PACKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Reference in New Issue
Block a user