Extend routing capabilities
The routing capabilities now define the type of output the reply processing chain expects. Currently, this only consists of two capabilities; complete packet output and contiguous buffer output. The latter implies the former.
This commit is contained in:
@ -36,6 +36,11 @@ typedef enum routing_capability
|
|||||||
/**< The transaction state and autocommit mode of the session are tracked;
|
/**< The transaction state and autocommit mode of the session are tracked;
|
||||||
implies RCAP_TYPE_CONTIGUOUS_INPUT and RCAP_TYPE_STMT_INPUT. */
|
implies RCAP_TYPE_CONTIGUOUS_INPUT and RCAP_TYPE_STMT_INPUT. */
|
||||||
RCAP_TYPE_TRANSACTION_TRACKING = 0x0007, /* 0b0000000000000111 */
|
RCAP_TYPE_TRANSACTION_TRACKING = 0x0007, /* 0b0000000000000111 */
|
||||||
|
/**< Responses are delivered one per buffer. */
|
||||||
|
RCAP_TYPE_STMT_OUTPUT = 0x0010, /* 0b0000000000010000 */
|
||||||
|
/**< Each delivered buffer is contiguous; implies RCAP_TYPE_STMT_OUTPUT. */
|
||||||
|
RCAP_TYPE_CONTIGUOUS_OUTPUT = 0x0030, /* 0b0000000000110000 */
|
||||||
|
|
||||||
} routing_capability_t;
|
} routing_capability_t;
|
||||||
|
|
||||||
#define RCAP_TYPE_NONE 0
|
#define RCAP_TYPE_NONE 0
|
||||||
|
|||||||
@ -769,10 +769,10 @@ gw_read_and_write(DCB *dcb)
|
|||||||
ss_dassert(read_buffer != NULL);
|
ss_dassert(read_buffer != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Ask what type of input the router/filter chain expects */
|
/** Ask what type of output the router/filter chain expects */
|
||||||
uint64_t capabilities = service_get_capabilities(session->service);
|
uint64_t capabilities = service_get_capabilities(session->service);
|
||||||
|
|
||||||
if (rcap_type_required(capabilities, RCAP_TYPE_STMT_INPUT))
|
if (rcap_type_required(capabilities, RCAP_TYPE_STMT_OUTPUT))
|
||||||
{
|
{
|
||||||
GWBUF *tmp = modutil_get_complete_packets(&read_buffer);
|
GWBUF *tmp = modutil_get_complete_packets(&read_buffer);
|
||||||
/* Put any residue into the read queue */
|
/* Put any residue into the read queue */
|
||||||
@ -787,7 +787,7 @@ gw_read_and_write(DCB *dcb)
|
|||||||
|
|
||||||
read_buffer = tmp;
|
read_buffer = tmp;
|
||||||
|
|
||||||
if (rcap_type_required(capabilities, RCAP_TYPE_CONTIGUOUS_INPUT))
|
if (rcap_type_required(capabilities, RCAP_TYPE_CONTIGUOUS_OUTPUT))
|
||||||
{
|
{
|
||||||
if ((tmp = gwbuf_make_contiguous(read_buffer)))
|
if ((tmp = gwbuf_make_contiguous(read_buffer)))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user