diff --git a/HISTORY b/HISTORY index f208f0f..890799f 100644 --- a/HISTORY +++ b/HISTORY @@ -1,5 +1,5 @@ -Version 1.44 2020-09-06 +Version 1.44 2020-09-08 * add test file src/tests/test_pthread_lock.c * add uniq_skiplist.[hc] * add function split_string_ex diff --git a/src/connection_pool.h b/src/connection_pool.h index 251dfce..f62810e 100644 --- a/src/connection_pool.h +++ b/src/connection_pool.h @@ -305,6 +305,16 @@ static inline void conn_pool_set_server_info(ConnectionInfo *pServerInfo, pServerInfo->sock = -1; } +static inline int conn_pool_compare_ip_and_port(const char *ip1, + const short port1, const char *ip2, const short port2) +{ + int result; + if ((result=strcmp(ip1, ip2)) != 0) { + return result; + } + return port1 - port2; +} + #ifdef __cplusplus } #endif