From 95797b9677097892e8629a81b01c040b63c5e94c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 5 May 2015 20:23:22 +0200 Subject: 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. --- vio/vio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'vio/vio.c') 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)); } -- cgit v1.2.1