pull/190/head
René Cannaò 12 years ago
parent 886cc02c63
commit 9de08dd9a2

@ -79,6 +79,8 @@ class MySQL_Data_Stream
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;
MySQL_Data_Stream();
~MySQL_Data_Stream();

@ -38,7 +38,7 @@ class MySQL_Session
// char *schema_name;
// char *schema_cur;
// char *schema_new;
int net_failure;
//int net_failure;
MySQL_Data_Stream *client_myds;
MySQL_Data_Stream *server_myds;

@ -294,7 +294,7 @@ void *child_mysql(void *arg) {
}
myds->revents=fds[0].revents;
myds->read_from_net();
if (sess->net_failure) goto __exit_child_mysql;
if (myds->net_failure) goto __exit_child_mysql;
myds->read_pkts();
sess->to_process=1;
int rc=sess->handler();

@ -112,6 +112,7 @@ MySQL_Data_Stream::MySQL_Data_Stream() {
DSS=STATE_NOT_CONNECTED;
encrypted=false;
ssl=NULL;
net_failure=false;
// ssl_ctx=NULL;
}
@ -189,15 +190,18 @@ void MySQL_Data_Stream::init(enum MySQL_DS_type _type, MySQL_Session *_sess, int
// Soft shutdown of socket : it only deactivate the data stream
// TODO: should check the status of the data stream, and identify if it is safe to reconnect or if the session should be destroyed
void MySQL_Data_Stream::shut_soft() {
proxy_debug(PROXY_DEBUG_NET, 4, "Shutdown soft fd=%d. Session=%p, DataStream=%p\n", fd, sess, this);
active=FALSE;
if (sess) sess->net_failure=1;
net_failure=true;
//if (sess) sess->net_failure=1;
}
// Hard shutdown of socket
void MySQL_Data_Stream::shut_hard() {
proxy_debug(PROXY_DEBUG_NET, 4, "Shutdown hard fd=%d. Session=%p, DataStream=%p\n", fd, sess, this);
net_failure=true;
if (fd >= 0) {
shutdown(fd, SHUT_RDWR);
close(fd);

Loading…
Cancel
Save