Commit d47c6ed8 authored by unknown's avatar unknown

Cleanups


client/mysqlmanagerc.c:
  Only use needed include files
libmysql/manager.c:
  cleanup include files
scripts/make_binary_distribution.sh:
  Fixed wrong filename
sql/mysqld.cc:
  cleanup
tools/mysqlmanager.c:
  Read with retrys
parent a88c72b3
...@@ -17,27 +17,15 @@ ...@@ -17,27 +17,15 @@
#define MANAGER_CLIENT_VERSION "1.0" #define MANAGER_CLIENT_VERSION "1.0"
#include <my_global.h> #include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <mysql.h> #include <mysql.h>
#include <mysql_version.h> #include <mysql_version.h>
#include <m_ctype.h>
#ifdef OS2
#include <config-os2.h>
#else
#include <my_config.h>
#endif
#include <my_dir.h>
#include <hash.h>
#include <mysqld_error.h> #include <mysqld_error.h>
#include <stdio.h> #include <my_sys.h>
#include <stdlib.h> #include <m_string.h>
#include <getopt.h> #include <getopt.h>
#include <stdarg.h> #include <stdarg.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include <violite.h>
#ifndef MYSQL_MANAGER_PORT #ifndef MYSQL_MANAGER_PORT
#define MYSQL_MANAGER_PORT 23546 #define MYSQL_MANAGER_PORT 23546
......
...@@ -16,31 +16,30 @@ ...@@ -16,31 +16,30 @@
MA 02111-1307, USA */ MA 02111-1307, USA */
#include <my_global.h> #include <my_global.h>
#if defined(__WIN__) || defined(_WIN32) || defined(_WIN64) #if defined(THREAD)
#include <winsock.h> #include <my_pthread.h> /* because of signal() */
#include <odbcinst.h>
#endif #endif
#include "mysql.h"
#include "mysql_version.h"
#include "mysqld_error.h"
#include <my_sys.h> #include <my_sys.h>
#include <mysys_err.h> #include <mysys_err.h>
#include <m_string.h> #include <m_string.h>
#include <m_ctype.h> #include <m_ctype.h>
#include "mysql.h" #include <my_net.h>
#include "mysql_version.h" #include <errmsg.h>
#include "mysqld_error.h"
#include "errmsg.h"
#include <violite.h> #include <violite.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <signal.h> #include <signal.h>
#include <time.h>
#include <errno.h> #include <errno.h>
#ifdef HAVE_PWD_H #if defined(OS2)
#include <pwd.h> # include <sys/un.h>
#elif !defined( __WIN__)
#include <sys/resource.h>
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif #endif
#if !defined(MSDOS) && !defined(__WIN__)
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#ifdef HAVE_SELECT_H #ifdef HAVE_SELECT_H
# include <select.h> # include <select.h>
...@@ -48,18 +47,13 @@ ...@@ -48,18 +47,13 @@
#ifdef HAVE_SYS_SELECT_H #ifdef HAVE_SYS_SELECT_H
#include <sys/select.h> #include <sys/select.h>
#endif #endif
#endif #include <sys/utsname.h>
#ifdef HAVE_SYS_UN_H #endif /* __WIN__ */
# include <sys/un.h>
#endif
#if defined(THREAD) && !defined(__WIN__)
#include <my_pthread.h> /* because of signal() */
#endif
#ifndef INADDR_NONE #ifndef INADDR_NONE
#define INADDR_NONE -1 #define INADDR_NONE -1
#endif #endif
#define RES_BUF_SHIFT 5 #define RES_BUF_SHIFT 5
#define SOCKET_ERROR -1 #define SOCKET_ERROR -1
#define NET_BUF_SIZE 2048 #define NET_BUF_SIZE 2048
......
...@@ -70,7 +70,7 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \ ...@@ -70,7 +70,7 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \
client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \
client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \ client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \
client/.libs/mysqlcheck \ client/.libs/mysqlcheck \
client/.libs/mysqlmanagerc client/libs/mysqlmanager-pwgen \ client/.libs/mysqlmanagerc client/.libs/mysqlmanager-pwgen \
tools/.libs/mysqlmanager tools/.libs/mysqlmanager
do do
if [ -f $i ] if [ -f $i ]
......
...@@ -77,9 +77,7 @@ extern "C" { // Because of SCO 3.2V4.2 ...@@ -77,9 +77,7 @@ extern "C" { // Because of SCO 3.2V4.2
#include <sys/select.h> #include <sys/select.h>
#endif #endif
#include <sys/utsname.h> #include <sys/utsname.h>
#else #endif /* __WIN__ */
#include <windows.h>
#endif // __WIN__
#ifdef HAVE_LIBWRAP #ifdef HAVE_LIBWRAP
#include <tcpd.h> #include <tcpd.h>
......
...@@ -88,6 +88,8 @@ ...@@ -88,6 +88,8 @@
#define MAX_LAUNCHER_MSG 256 #define MAX_LAUNCHER_MSG 256
#endif #endif
#define MAX_RETRY_COUNT 100
/* Variable naming convention - if starts with manager_, either is set /* Variable naming convention - if starts with manager_, either is set
directly by the user, or used closely in ocnjunction with a variable directly by the user, or used closely in ocnjunction with a variable
set by the user set by the user
...@@ -1161,10 +1163,15 @@ static char* read_line(struct manager_thd* thd) ...@@ -1161,10 +1163,15 @@ static char* read_line(struct manager_thd* thd)
{ {
int len,read_len; int len,read_len;
char *block_end,*p_back; char *block_end,*p_back;
uint retry_count=0;
read_len = min(NET_BLOCK,(uint)(buf_end-p)); 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; thd->fatal=1;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment