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

pull/1/head
yuqing 2014-06-27 15:12:41 +08:00
parent 28dcc9d099
commit 701bc391bc
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,5 @@
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

View File

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