diff options
author | monty@hundin.mysql.fi <> | 2001-10-11 22:02:16 +0300 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-10-11 22:02:16 +0300 |
commit | 6afbeb4cf4797f8843acf2ee3572476cea67cc73 (patch) | |
tree | 6e9587de81599ae478e9d6deedc5fd8a0f4fd970 /tools | |
parent | ac250625dc6030538c5c9ccb5907fc53b160f2db (diff) | |
download | mariadb-git-6afbeb4cf4797f8843acf2ee3572476cea67cc73.tar.gz |
Cleanups
Diffstat (limited to 'tools')
-rw-r--r-- | tools/mysqlmanager.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/mysqlmanager.c b/tools/mysqlmanager.c index f2f89c6bc07..9cb04505e2f 100644 --- a/tools/mysqlmanager.c +++ b/tools/mysqlmanager.c @@ -88,6 +88,8 @@ #define MAX_LAUNCHER_MSG 256 #endif +#define MAX_RETRY_COUNT 100 + /* Variable naming convention - if starts with manager_, either is set directly by the user, or used closely in ocnjunction with a variable set by the user @@ -1161,10 +1163,15 @@ static char* read_line(struct manager_thd* thd) { int len,read_len; char *block_end,*p_back; + uint retry_count=0; + read_len = min(NET_BLOCK,(uint)(buf_end-p)); - if ((len=vio_read(thd->vio,p,read_len))<=0) + while ((len=vio_read(thd->vio,p,read_len))<=0) { - log_err("Error reading command from client"); + if (vio_should_retry(thd->vio) && retry_count++ < MAX_RETRY_COUNT) + continue; + log_err("Error reading command from client (Error: %d)", + vio_errno(thd->vio)); thd->fatal=1; return 0; } |