mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1 extra/perror.c: Auto merged include/my_global.h: Auto merged mysql-test/r/ps_6bdb.result: Auto merged mysql-test/r/ps_7ndb.result: Auto merged BitKeeper/deleted/.del-var~62c955ccf2da1a21: Auto merged mysql-test/t/disabled.def: Auto merged sql/field.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/item.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged storage/ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged storage/ndb/src/mgmsrv/ConfigInfo.hpp: Auto merged storage/ndb/src/mgmsrv/main.cpp: Auto merged
This commit is contained in:
@ -779,29 +779,19 @@ static int check_connection(THD *thd)
|
||||
return (ER_OUT_OF_RESOURCES);
|
||||
thd->host_or_ip= thd->ip;
|
||||
vio_in_addr(net->vio,&thd->remote.sin_addr);
|
||||
#if !defined(HAVE_SYS_UN_H) || defined(HAVE_mit_thread)
|
||||
/* Fast local hostname resolve for Win32 */
|
||||
if (!strcmp(thd->ip,"127.0.0.1"))
|
||||
if (!(specialflag & SPECIAL_NO_RESOLVE))
|
||||
{
|
||||
thd->host= (char*) my_localhost;
|
||||
thd->host_or_ip= my_localhost;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (!(specialflag & SPECIAL_NO_RESOLVE))
|
||||
vio_in_addr(net->vio,&thd->remote.sin_addr);
|
||||
thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors);
|
||||
/* Cut very long hostnames to avoid possible overflows */
|
||||
if (thd->host)
|
||||
{
|
||||
vio_in_addr(net->vio,&thd->remote.sin_addr);
|
||||
thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors);
|
||||
/* Cut very long hostnames to avoid possible overflows */
|
||||
if (thd->host)
|
||||
{
|
||||
thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0;
|
||||
thd->host_or_ip= thd->host;
|
||||
}
|
||||
if (connect_errors > max_connect_errors)
|
||||
return(ER_HOST_IS_BLOCKED);
|
||||
if (thd->host != my_localhost)
|
||||
thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0;
|
||||
thd->host_or_ip= thd->host;
|
||||
}
|
||||
if (connect_errors > max_connect_errors)
|
||||
return(ER_HOST_IS_BLOCKED);
|
||||
}
|
||||
DBUG_PRINT("info",("Host: %s ip: %s",
|
||||
thd->host ? thd->host : "unknown host",
|
||||
|
Reference in New Issue
Block a user