If SSL is used for frontend connections or fast_forward , try to consume all the bytes on the network buffer

pull/4083/head
René Cannaò 3 years ago
parent 22ff0feea4
commit b1a14bd303

@ -1375,11 +1375,11 @@ static void *child_mysql(void *arg) {
// PMC-10004
// we probably should use SSL_pending() and/or SSL_has_pending() to determine
// if there is more data to be read, but it doesn't seem to be working.
// Therefore we hardcored the values 4096 (4K) as a special case and
// we try to call read_from_net() again.
// Therefore we try to call read_from_net() again as long as there is data.
// Previously we hardcoded 16KB but it seems that it can return in smaller
// chunks of 4KB.
while (rb > 0 && rb%4096 == 0) {
// We finally removed the chunk size as it seems that any size is possible.
while (rb > 0) {
rb = myds->read_from_net();
if (myds->net_failure) goto __exit_child_mysql;
myds->read_pkts();

@ -3598,15 +3598,17 @@ bool MySQL_Thread::process_data_on_data_stream(MySQL_Data_Stream *myds, unsigned
// PMC-10004
// we probably should use SSL_pending() and/or SSL_has_pending() to determine
// if there is more data to be read, but it doesn't seem to be working.
// Therefore we hardcored the value 16384 (16KB) as a special case and
// we try to call read_from_net() again
// Therefore we try to call read_from_net() again as long as there is data.
// Previously we hardcoded 16KB but it seems that it can return in smaller
// chunks of 4KB.
// We finally removed the chunk size as it seems that any size is possible.
/*
int sslp = SSL_pending(myds->ssl);
int sslhp = SSL_has_pending(myds->ssl);
proxy_debug(PROXY_DEBUG_NET, 5, "Session=%p: in fast_forward mode and SSL read %d bytes , SSL_pending: %d bytes , SSL_has_pending: %d\n", myds->sess, rb, sslp, sslhp);
*/
proxy_debug(PROXY_DEBUG_NET, 5, "Session=%p, DataStream=%p , thread_session_id=%u -- in fast_forward mode and SSL read %d bytes\n", myds->sess, myds, myds->sess->thread_session_id, rb);
while (rb == 16384) {
while (rb > 0) {
rb = myds->read_from_net();
if (rb > 0 && myds->myds_type == MYDS_FRONTEND) {
status_variables.stvar[st_var_queries_frontends_bytes_recv] += rb;

@ -5466,11 +5466,11 @@ void *child_mysql(void *arg) {
// PMC-10004
// we probably should use SSL_pending() and/or SSL_has_pending() to determine
// if there is more data to be read, but it doesn't seem to be working.
// Therefore we hardcored the values 4096 (4K) as a special case and
// we try to call read_from_net() again.
// Therefore we try to call read_from_net() again as long as there is data.
// Previously we hardcoded 16KB but it seems that it can return in smaller
// chunks of 4KB.
while (rb > 0 && rb%4096 == 0) {
// We finally removed the chunk size as it seems that any size is possible.
while (rb > 0) {
rb = myds->read_from_net();
if (myds->net_failure) goto __exit_child_mysql;
myds->read_pkts();

@ -944,11 +944,11 @@ static void *child_mysql(void *arg) {
// PMC-10004
// we probably should use SSL_pending() and/or SSL_has_pending() to determine
// if there is more data to be read, but it doesn't seem to be working.
// Therefore we hardcored the values 4096 (4K) as a special case and
// we try to call read_from_net() again.
// Therefore we try to call read_from_net() again as long as there is data.
// Previously we hardcoded 16KB but it seems that it can return in smaller
// chunks of 4KB.
while (rb > 0 && rb%4096 == 0) {
// We finally removed the chunk size as it seems that any size is possible.
while (rb > 0) {
rb = myds->read_from_net();
if (myds->net_failure) goto __exit_child_mysql;
myds->read_pkts();

Loading…
Cancel
Save