diff options
author | unknown <jimw@mysql.com> | 2005-01-25 12:06:55 -0800 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-01-25 12:06:55 -0800 |
commit | 74b38a0e0cc6f07d2e3ef657b002618e9aef8cb8 (patch) | |
tree | 6eba82bf12f39ade3bb5bcddcc938ff32f334a3d /sql/sql_parse.cc | |
parent | 22ecb9ce421a796be53754b96b37c9bfa3a898b6 (diff) | |
download | mariadb-git-74b38a0e0cc6f07d2e3ef657b002618e9aef8cb8.tar.gz |
Always call vio_in_addr() so that thd->remote is
always initialized. (Bug #5569)
vio/viosocket.c:
Remove comment that is no longer correct
sql/sql_parse.cc:
Always call vio_in_addr() on successful connection,
so that thd->remote always gets set
vio/viossl.c:
Remove comment that is no longer correct
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1aeb158dc11..efb534ed439 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -501,6 +501,9 @@ check_connections(THD *thd) thd->thread_id)); DBUG_PRINT("info",("New connection received on %s", vio_description(net->vio))); + + vio_in_addr(net->vio,&thd->remote.sin_addr); + if (!thd->host) // If TCP/IP connection { char ip[30]; @@ -521,7 +524,6 @@ check_connections(THD *thd) #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) @@ -543,7 +545,6 @@ check_connections(THD *thd) DBUG_PRINT("info",("Host: %s",thd->host)); thd->host_or_ip= thd->host; thd->ip= 0; - bzero((char*) &thd->remote,sizeof(struct sockaddr)); } vio_keepalive(net->vio, TRUE); |