Skip to content

Commit

Permalink
Merge pull request #3392 from sysown/v2.1.1-3342
Browse files Browse the repository at this point in the history
Closes #3342: ProxySQL reset connection if it starts with COM_QUIT
  • Loading branch information
renecannao authored Apr 6, 2021
2 parents 134517d + 83acc66 commit 1c2b7e4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/MySQL_Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5245,6 +5245,12 @@ void MySQL_Thread::listener_handle_new_connection(MySQL_Data_Stream *myds, unsig
ioctl_FIONBIO(sess->client_myds->fd, 1);
mypolls.add(POLLIN|POLLOUT, sess->client_myds->fd, sess->client_myds, curtime);
proxy_debug(PROXY_DEBUG_NET,1,"Session=%p -- Adding client FD %d\n", sess, sess->client_myds->fd);

// we now enforce sending the 'initial handshake packet' as soon as it's generated. This
// is done to prevent situations in which a client sends a packet *before* receiving
// this 'initial handshake', leading to invalid state in dataflow, since it will be
// data in both ends of the datastream. For more details see #3342.
sess->writeout();
} else {
free(addr);
// if we arrive here, accept() failed
Expand Down

0 comments on commit 1c2b7e4

Please sign in to comment.