session.c:session_free:if session is child of another service (tee in this case), it is the parent which releases child's allocated memory back to the system. This now also includes the child router session.
dcb.h: Added DCB_IS_CLONE macro
tee.c:freeSession:if parent session triggered closing of tee, then child session may not be closed yet. In that case free the child session first and only then free child router session and release child session's memory back to system.
tee.c:routeQuery: only route if child session is ready for routing. Log if session is not ready for routing and set tee session inactive
mysql_client.c:gw_client_close:if DCB is cloned one don't close the protocol because they it is shared with the original DCB.
This commit is contained in:
VilhoRaatikka
2014-12-23 00:26:57 +02:00
parent 61fcc1e21e
commit f0d8ed0cf2
7 changed files with 98 additions and 57 deletions

View File

@ -130,7 +130,6 @@ typedef struct {
#define GWPROTOCOL_VERSION {1, 0, 0}
#define DCBFD_CLOSED -1
#define DCBFD_CLONED -2
/**
* The statitics gathered on a descriptor control block
@ -332,4 +331,6 @@ bool dcb_get_ses_log_info(DCB* dcb, size_t* sesid, int* enabled_logs);
*/
#define DCBF_CLONE 0x0001 /*< DCB is a clone */
#define DCBF_HUNG 0x0002 /*< Hangup has been dispatched */
#define DCB_IS_CLONE(d) ((d)->flags & DCBF_CLONE)
#endif /* _DCB_H */