|
|
|
|
@ -8,10 +8,10 @@
|
|
|
|
|
#define QUEUE_T_DEFAULT_SIZE 32768
|
|
|
|
|
|
|
|
|
|
typedef struct _queue_t {
|
|
|
|
|
void *buffer;
|
|
|
|
|
unsigned int size;
|
|
|
|
|
unsigned int head;
|
|
|
|
|
unsigned int tail;
|
|
|
|
|
void *buffer;
|
|
|
|
|
unsigned int size;
|
|
|
|
|
unsigned int head;
|
|
|
|
|
unsigned int tail;
|
|
|
|
|
unsigned int partial;
|
|
|
|
|
//unsigned char *pkt;
|
|
|
|
|
PtrSize_t pkt;
|
|
|
|
|
@ -66,6 +66,35 @@ class MySQL_Data_Stream
|
|
|
|
|
public:
|
|
|
|
|
void * operator new(size_t);
|
|
|
|
|
void operator delete(void *);
|
|
|
|
|
|
|
|
|
|
queue_t queueIN;
|
|
|
|
|
uint64_t pkts_recv; // counter of received packets
|
|
|
|
|
queue_t queueOUT;
|
|
|
|
|
uint64_t pkts_sent; // counter of sent packets
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
PtrSize_t pkt;
|
|
|
|
|
unsigned int partial;
|
|
|
|
|
} CompPktIN;
|
|
|
|
|
struct {
|
|
|
|
|
PtrSize_t pkt;
|
|
|
|
|
unsigned int partial;
|
|
|
|
|
} CompPktOUT;
|
|
|
|
|
|
|
|
|
|
MyDS_real_query mysql_real_query;
|
|
|
|
|
|
|
|
|
|
PtrSize_t multi_pkt;
|
|
|
|
|
|
|
|
|
|
unsigned long long wait_until;
|
|
|
|
|
unsigned long long killed_at;
|
|
|
|
|
unsigned long long max_connect_time;
|
|
|
|
|
|
|
|
|
|
PtrSizeArray *PSarrayIN;
|
|
|
|
|
PtrSizeArray *PSarrayOUT;
|
|
|
|
|
PtrSizeArray *PSarrayOUTpending;
|
|
|
|
|
PtrSizeArray *resultset;
|
|
|
|
|
unsigned int resultset_length;
|
|
|
|
|
|
|
|
|
|
unsigned int connect_tries;
|
|
|
|
|
ProxySQL_Poll *mypolls;
|
|
|
|
|
int array2buffer_full();
|
|
|
|
|
@ -77,51 +106,25 @@ class MySQL_Data_Stream
|
|
|
|
|
enum MySQL_DS_type myds_type;
|
|
|
|
|
MySQL_Session *sess; // pointer to the session using this data stream
|
|
|
|
|
MySQL_Backend *mybe; // if this is a connection to a mysql server, this points to a backend structure
|
|
|
|
|
uint64_t pkts_recv; // counter of received packets
|
|
|
|
|
uint64_t pkts_sent; // counter of sent packets
|
|
|
|
|
bytes_stats_t bytes_info; // bytes statistics
|
|
|
|
|
int fd; // file descriptor
|
|
|
|
|
|
|
|
|
|
struct sockaddr *client_addr;
|
|
|
|
|
socklen_t client_addrlen;
|
|
|
|
|
|
|
|
|
|
unsigned long long wait_until;
|
|
|
|
|
unsigned long long killed_at;
|
|
|
|
|
unsigned long long max_connect_time;
|
|
|
|
|
int poll_fds_idx;
|
|
|
|
|
short revents;
|
|
|
|
|
|
|
|
|
|
bool encrypted;
|
|
|
|
|
SSL *ssl;
|
|
|
|
|
|
|
|
|
|
queue_t queueIN;
|
|
|
|
|
queue_t queueOUT;
|
|
|
|
|
//struct evbuffer *evbIN;
|
|
|
|
|
//struct evbuffer *evbOUT;
|
|
|
|
|
//GPtrArray *QarrayIN;
|
|
|
|
|
//GPtrArray *QarrayOUT;
|
|
|
|
|
PtrSizeArray *PSarrayIN;
|
|
|
|
|
PtrSizeArray *PSarrayOUT;
|
|
|
|
|
PtrSizeArray *PSarrayOUTpending;
|
|
|
|
|
PtrSizeArray *resultset;
|
|
|
|
|
unsigned int resultset_length;
|
|
|
|
|
|
|
|
|
|
int active_transaction; // 1 if there is an active transaction
|
|
|
|
|
int active; // data stream is active. If not, shutdown+close needs to be called
|
|
|
|
|
int status; // status . FIXME: make it a ORable variable
|
|
|
|
|
|
|
|
|
|
bool net_failure;
|
|
|
|
|
short revents;
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
PtrSize_t pkt;
|
|
|
|
|
unsigned int partial;
|
|
|
|
|
} CompPktIN;
|
|
|
|
|
struct {
|
|
|
|
|
PtrSize_t pkt;
|
|
|
|
|
unsigned int partial;
|
|
|
|
|
} CompPktOUT;
|
|
|
|
|
bool encrypted;
|
|
|
|
|
bool net_failure;
|
|
|
|
|
|
|
|
|
|
PtrSize_t multi_pkt;
|
|
|
|
|
uint8_t pkt_sid;
|
|
|
|
|
|
|
|
|
|
// struct {
|
|
|
|
|
@ -129,7 +132,6 @@ class MySQL_Data_Stream
|
|
|
|
|
// unsigned int size;
|
|
|
|
|
// } mysql_real_query;
|
|
|
|
|
|
|
|
|
|
MyDS_real_query mysql_real_query;
|
|
|
|
|
|
|
|
|
|
MySQL_Data_Stream();
|
|
|
|
|
~MySQL_Data_Stream();
|
|
|
|
|
|