Move some definitions and add something private

definitions from asyncqueue to asyncprotocol to reduce dependency loops
add protocol-private data structure and killer routine
This commit is contained in:
Douglas Clowes
2014-08-20 13:34:15 +10:00
parent 3d475d3598
commit 5fa021ce88
3 changed files with 21 additions and 7 deletions

View File

@@ -26,6 +26,12 @@ typedef enum {
ATX_DISCO = 3
} ATX_STATUS;
#define AQU_TIMEOUT -1
#define AQU_DISCONNECT -2
#define AQU_RECONNECT -3
#define AQU_RETRY_CMD -4
#define AQU_POP_CMD -5
struct __async_txn {
pAsyncUnit unit; /**< unit that transaction is associated with */
int txn_state; /**< protocol handler transaction parse state */
@@ -38,6 +44,8 @@ struct __async_txn {
int inp_len; /**< length of input buffer */
int inp_idx; /**< index of next character (number already received) */
AsyncTxnHandler handleResponse; /**< Txn response handler of command sender */
void *proto_private; /**< Protocol Private structure */
void (*kill_private) (struct __async_txn *pTxn); /**< if it needs killing */
void *cntx; /**< opaque context used by command sender */
/* The cntx field may be used by protocol handler from sendCommand
* as long as it is restored when response is complete