提交 701bc391 编写于 作者: Y yuqing

bug fixed: connection pool should NOT increase counter when connect fail

上级 28dcc9d0
Version 1.06 2014-06-24
Version 1.06 2014-06-27
* update source code from FastDFS V5.02
* add function short2buff and buff2short
* add object memory pool (fast_mblock.h and fast_mblock.c)
......@@ -13,6 +13,7 @@ Version 1.06 2014-06-24
* #include <stdbool.h> to use C99 bool
* add libfastcommon.spec for building RPM
* logger can delete old rotated files
* bug fixed: connection pool should NOT increase counter when connect fail
Version 1.05 2012-07-08
* update source code from FastDFS V3.09
......
......@@ -202,6 +202,10 @@ ConnectionInfo *conn_pool_get_connection(ConnectionPool *cp,
cp->connect_timeout);
if (*err_no != 0)
{
pthread_mutex_lock(&cm->lock);
cm->total_count--; //rollback
pthread_mutex_unlock(&cm->lock);
free(p);
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册