diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-05-05 20:23:22 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-05-05 21:56:46 +0200 |
commit | 95797b9677097892e8629a81b01c040b63c5e94c (patch) | |
tree | fdae369f262177f3a7b7401634a4f6c67d2a2f5f /client/mysqltest.cc | |
parent | d3a3adb8337ae530cbcb75719f55889d1352b98f (diff) | |
download | mariadb-git-95797b9677097892e8629a81b01c040b63c5e94c.tar.gz |
MDEV-8096 vio timeouts are multiplied by 1000 for ssl
in when using vio->read_timeout (and write_timeout) to set
timeouts of a new vio, as in:
vio_timeout(vio, 0, old_vio.read_timeout)
vio_timeout(vio, 0, old_vio.write_timeout)
remember that timeouts are stored in ms, but vio_timeout()'s
argument is in seconds.
Diffstat (limited to 'client/mysqltest.cc')
-rw-r--r-- | client/mysqltest.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 9b7a6e8fd19..697229f9439 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5912,6 +5912,8 @@ void do_connect(struct st_command *command) my_bool con_ssl= 0, con_compress= 0; my_bool con_pipe= 0; my_bool con_shm __attribute__ ((unused))= 0; + int read_timeout= 0; + int write_timeout= 0; struct st_connection* con_slot; static DYNAMIC_STRING ds_connection_name; @@ -6008,6 +6010,16 @@ void do_connect(struct st_command *command) con_pipe= 1; else if (length == 3 && !strncmp(con_options, "SHM", 3)) con_shm= 1; + else if (strncasecmp(con_options, "read_timeout=", + sizeof("read_timeout=")-1) == 0) + { + read_timeout= atoi(con_options + sizeof("read_timeout=")-1); + } + else if (strncasecmp(con_options, "write_timeout=", + sizeof("write_timeout=")-1) == 0) + { + write_timeout= atoi(con_options + sizeof("write_timeout=")-1); + } else die("Illegal option to connect: %.*s", (int) (end - con_options), con_options); @@ -6080,6 +6092,18 @@ void do_connect(struct st_command *command) if (opt_protocol) mysql_options(con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); + if (read_timeout) + { + mysql_options(con_slot->mysql, MYSQL_OPT_READ_TIMEOUT, + (char*)&read_timeout); + } + + if (write_timeout) + { + mysql_options(con_slot->mysql, MYSQL_OPT_WRITE_TIMEOUT, + (char*)&write_timeout); + } + #ifdef HAVE_SMEM if (con_shm) { |