From 6682b9842e4e33d54a7335a6276b64755fb77680 Mon Sep 17 00:00:00 2001 From: yuqing Date: Wed, 18 May 2016 11:18:15 +0800 Subject: [PATCH] conn_pool_init compatable --- src/connection_pool.c | 8 ++++++++ src/connection_pool.h | 9 ++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/connection_pool.c b/src/connection_pool.c index 804b181..39dfc25 100644 --- a/src/connection_pool.c +++ b/src/connection_pool.c @@ -33,6 +33,14 @@ int conn_pool_init_ex(ConnectionPool *cp, int connect_timeout, \ return hash_init(&(cp->hash_array), simple_hash, 1024, 0.75); } +int conn_pool_init(ConnectionPool *cp, int connect_timeout, + const int max_count_per_entry, const int max_idle_time) +{ + const int socket_domain = AF_INET; + return conn_pool_init_ex(cp, connect_timeout, max_count_per_entry, + max_idle_time, socket_domain); +} + int coon_pool_close_connections(const int index, const HashData *data, void *args) { ConnectionManager *cm; diff --git a/src/connection_pool.h b/src/connection_pool.h index 4358b18..ac0d070 100644 --- a/src/connection_pool.h +++ b/src/connection_pool.h @@ -84,13 +84,8 @@ int conn_pool_init_ex(ConnectionPool *cp, int connect_timeout, * max_idle_time: reconnect the server after max idle time in seconds * return 0 for success, != 0 for error */ -static inline int conn_pool_init(ConnectionPool *cp, int connect_timeout, - const int max_count_per_entry, const int max_idle_time) -{ - const int socket_domain = AF_INET; - return conn_pool_init_ex(cp, connect_timeout, max_count_per_entry, - max_idle_time, socket_domain); -} +int conn_pool_init(ConnectionPool *cp, int connect_timeout, + const int max_count_per_entry, const int max_idle_time); /** * destroy function