From a8a5e98ec6a1170173d897b0da0d39866c79c7ba Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Aug 2005 19:19:28 +0400 Subject: Fixes bug #5588. vio_was_interrupted() function was added to detect read timeout properly on win32. include/my_global.h: Added win32 specific socket timeout error code. include/violite.h: Added vio_was_interrupted function that returns true if operation was not completed due to timeout. sql/mini_client.cc: added a check that replication read was not completed due to timeout. sql/net_serv.cc: net->last_errno should be equal to ER_NET_READ_INTERRUPTED in case if read operation was not completed due to timeout. vio/vio.c: added initialization code for vio_was_interrupted() function. vio/viosocket.c: Added vio_was_interrupted function that returns true if operation was not completed due to timeout. --- sql/mini_client.cc | 2 +- sql/net_serv.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sql') diff --git a/sql/mini_client.cc b/sql/mini_client.cc index 86d50dc9a0e..cd00db5c7df 100644 --- a/sql/mini_client.cc +++ b/sql/mini_client.cc @@ -399,7 +399,7 @@ mc_net_safe_read(MYSQL *mysql) { DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %d", vio_description(net->vio),len)); - if (socket_errno != SOCKET_EINTR) + if (!vio_was_interrupted(net->vio)) { mc_end_server(mysql); if (net->last_errno != ER_NET_PACKET_TOO_LARGE) diff --git a/sql/net_serv.cc b/sql/net_serv.cc index c527ee1eb76..1e66bfc3e19 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -700,7 +700,7 @@ my_real_read(NET *net, ulong *complen) len= packet_error; net->error=2; /* Close socket */ #ifdef MYSQL_SERVER - net->last_errno= (interrupted ? ER_NET_READ_INTERRUPTED : + net->last_errno= (vio_was_interrupted(net->vio) ? ER_NET_READ_INTERRUPTED : ER_NET_READ_ERROR); #endif goto end; -- cgit v1.2.1