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 /vio | |
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 'vio')
-rw-r--r-- | vio/vio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vio/vio.c b/vio/vio.c index 97e3d49be21..e3bc8ca8ab8 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -227,12 +227,15 @@ my_bool vio_reset(Vio* vio, enum enum_vio_type type, Propagate the timeout values. Necessary to also propagate the underlying proprieties associated with the timeout, such as the socket blocking mode. + + note: old_vio.read_timeout/old_vio.write_timeout is stored in ms + but vio_timeout() takes seconds as argument, hence the / 1000 */ if (old_vio.read_timeout >= 0) - ret|= vio_timeout(vio, 0, old_vio.read_timeout); + ret|= vio_timeout(vio, 0, old_vio.read_timeout / 1000); if (old_vio.write_timeout >= 0) - ret|= vio_timeout(vio, 1, old_vio.write_timeout); + ret|= vio_timeout(vio, 1, old_vio.write_timeout / 1000); DBUG_RETURN(MY_TEST(ret)); } |