add func conn_pool_compare_ip_and_port

pull/37/head
YuQing 2020-09-08 09:06:26 +08:00
parent a749b84ce2
commit 130d7fe110
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -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