mirror of
https://github.com/MariaDB/server.git
synced 2025-04-09 08:45:33 +02:00
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.
This commit is contained in:
parent
0c0a865fad
commit
2a45fa900b
4 changed files with 19 additions and 4 deletions
|
@ -1471,10 +1471,6 @@ int SSL_peek(SSL* ssl, void* buffer, int sz)
|
|||
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
7
mysql-test/r/ssl_timeout-9836.result
Normal file
7
mysql-test/r/ssl_timeout-9836.result
Normal file
|
@ -0,0 +1,7 @@
|
|||
SET @@net_read_timeout=1;
|
||||
SELECT 1;
|
||||
1
|
||||
1
|
||||
SELECT 1;
|
||||
1
|
||||
1
|
1
mysql-test/t/ssl_timeout-9836.opt
Normal file
1
mysql-test/t/ssl_timeout-9836.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--loose-thread-handling=pool-of-threads
|
11
mysql-test/t/ssl_timeout-9836.test
Normal file
11
mysql-test/t/ssl_timeout-9836.test
Normal file
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
# 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;
|
Loading…
Add table
Reference in a new issue