summaryrefslogtreecommitdiff
path: root/extra/yassl/include
diff options
context:
space:
mode:
authorunknown <dkatz@damien-katzs-computer.local>2007-07-12 22:06:33 -0400
committerunknown <dkatz@damien-katzs-computer.local>2007-07-12 22:06:33 -0400
commitb7527f6b72cbd3d919671ed15262b1893166e125 (patch)
treed6585a05edfef5208ae906f073d0280bb05f4679 /extra/yassl/include
parentd99af83936d2061f6fa78eeb9b47081d8cf9b81b (diff)
downloadmariadb-git-b7527f6b72cbd3d919671ed15262b1893166e125.tar.gz
Bug #29579 Clients using SSL can hang the server
Added an option to yassl to allow "quiet shutdown" like openssl does. This option causes the SSL libs to NOT perform the close_notify handshake during shutdown. This fixes a hang we experience because we hold a lock during socket shutdown. mysql-test/t/ssl_big.test: BitKeeper file /Users/dkatz/50/mysql-test/t/ssl_big.test mysql-test/r/ssl-big.result: BitKeeper file /Users/dkatz/50/mysql-test/r/ssl-big.result client/mysqltest.c: Added new command to mysqltest to send a quit command to the server, but to not close the actual socket on our end. Also changed code to reuse connection slots, so that the tests can open and close sockets in a loop. extra/yassl/include/openssl/ssl.h: Added C accessors to the quietShutdown option. extra/yassl/include/yassl_int.hpp: Added quietShutdown_ member and accessor methods to the SSL class. extra/yassl/src/ssl.cpp: Added accessors to get/set the quietShutdown option and to not perform the shutdown handshake if quietShutdown is set. extra/yassl/src/yassl_int.cpp: Added quietShutdown_ member and accessor methods to the SSL class. vio/viossl.c: Added line to set the quiet_shutdown option before shutting down the socket. mysql-test/t/ssl-big.test: Added a test that causes an unpatched server to hang during SSL socket shutdown.
Diffstat (limited to 'extra/yassl/include')
-rw-r--r--extra/yassl/include/openssl/ssl.h2
-rw-r--r--extra/yassl/include/yassl_int.hpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index 7dd33e3fcad..efd0dec75b6 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -277,6 +277,8 @@ int SSL_session_reused(SSL*);
int SSL_set_rfd(SSL*, int);
int SSL_set_wfd(SSL*, int);
void SSL_set_shutdown(SSL*, int);
+void SSL_set_quiet_shutdown(SSL *ssl,int mode);
+int SSL_get_quiet_shutdown(SSL *ssl);
int SSL_want_read(SSL*);
int SSL_want_write(SSL*);
diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp
index 94cb85c3300..b207f0bffbd 100644
--- a/extra/yassl/include/yassl_int.hpp
+++ b/extra/yassl/include/yassl_int.hpp
@@ -584,6 +584,7 @@ class SSL {
Socket socket_; // socket wrapper
Buffers buffers_; // buffered handshakes and data
Log log_; // logger
+ bool quietShutdown_;
// optimization variables
bool has_data_; // buffered data ready?
@@ -610,6 +611,7 @@ public:
Buffers& useBuffers();
bool HasData() const;
+ bool GetQuietShutdown() const;
// sets
void set_pending(Cipher suite);
@@ -621,6 +623,7 @@ public:
void SetError(YasslError);
int SetCompression();
void UnSetCompression();
+ void SetQuietShutdown(bool mode);
// helpers
bool isTLS() const;