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:
Markus Makela 2016-11-23 10:36:11 +02:00
parent 43f248927e
commit b32af705e6
2 changed files with 8 additions and 3 deletions

View File

@ -36,6 +36,11 @@ typedef enum routing_capability
/**< The transaction state and autocommit mode of the session are tracked;
implies RCAP_TYPE_CONTIGUOUS_INPUT and RCAP_TYPE_STMT_INPUT. */
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;
#define RCAP_TYPE_NONE 0

View File

@ -769,10 +769,10 @@ gw_read_and_write(DCB *dcb)
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);
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);
/* Put any residue into the read queue */
@ -787,7 +787,7 @@ gw_read_and_write(DCB *dcb)
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)))
{