Prevent connection double counts in tests
The function would count a connection twice if hostname resolution was not enabled and both the host and the IP matched.
This commit is contained in:
parent
601c2d6633
commit
47092ed18a
@ -456,12 +456,11 @@ int get_conn_num(MYSQL* conn, std::string ip, std::string hostname, std::string
|
||||
row = mysql_fetch_row(res);
|
||||
if ((row[2] != NULL ) && (row[3] != NULL))
|
||||
{
|
||||
if ((strstr(row[2], ip.c_str()) != NULL) && (strstr(row[3], db.c_str()) != NULL))
|
||||
if (strstr(row[2], ip.c_str()) && strstr(row[3], db.c_str()))
|
||||
{
|
||||
conn_num++;
|
||||
}
|
||||
if ((strstr(row[2],
|
||||
hostname_internal) != NULL) && (strstr(row[3], db.c_str()) != NULL))
|
||||
else if (strstr(row[2], hostname_internal) && strstr(row[3], db.c_str()))
|
||||
{
|
||||
conn_num++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user