Commit 2a45fa90 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub Committed by Sergei Golubchik

MDEV-9836 Connection lost when using SSL

Don't read from socket in yassl in SSL_pending().
Just return size of the buffered processed data.
This is what OpenSSL is documented to do too:

  SSL_pending() returns the number of bytes which have been processed,
  buffered and are available inside ssl for immediate read.
parent 0c0a865f
...@@ -1471,10 +1471,6 @@ int SSL_peek(SSL* ssl, void* buffer, int sz) ...@@ -1471,10 +1471,6 @@ int SSL_peek(SSL* ssl, void* buffer, int sz)
int SSL_pending(SSL* ssl) int SSL_pending(SSL* ssl)
{ {
// Just in case there's pending data that hasn't been processed yet...
char c;
SSL_peek(ssl, &c, 1);
return ssl->bufferedData(); return ssl->bufferedData();
} }
......
SET @@net_read_timeout=1;
SELECT 1;
1
1
SELECT 1;
1
1
--loose-thread-handling=pool-of-threads
#
# MDEV-9836 Connection lost when using SSL
#
-- source include/have_ssl_communication.inc
connect(con1,localhost,root,,,,,SSL);
SET @@net_read_timeout=1;
SELECT 1;
# MDEV-9836 - YASSL bug - SSL connection lost if it has been idle, for longer than net_read_timeout
-- sleep 2
SELECT 1;
disconnect con1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment