From: Arran Cudbard-Bell Date: Sat, 27 Jun 2015 23:56:44 +0000 (-0400) Subject: Remove pool_get_opaque X-Git-Tag: release_3_0_9~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0f84434fa687ad485238af765a878e88999f0ea;p=thirdparty%2Ffreeradius-server.git Remove pool_get_opaque that was going to be a hacky way to modify opaque data. We have a much better way to do this in v3.1.x, but the code is probably too dangerous to merge into a 'stable' branch. --- diff --git a/src/include/connection.h b/src/include/connection.h index 951a6acba6e..468d763873f 100644 --- a/src/include/connection.h +++ b/src/include/connection.h @@ -95,8 +95,6 @@ fr_connection_pool_t *fr_connection_pool_copy(TALLOC_CTX *ctx, fr_connection_poo */ int fr_connection_pool_get_num(fr_connection_pool_t *pool); -void *fr_connection_pool_get_opaque(fr_connection_pool_t *pool); - /* * Pool management */ diff --git a/src/main/connection.c b/src/main/connection.c index 4b44f30417f..e48a1a34311 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -1247,20 +1247,6 @@ int fr_connection_pool_get_num(fr_connection_pool_t *pool) return pool->num; } -/** Get the opaque data associated with a pool - * - * @note returned pointer is left non-const intentionally. It's up to the caller - * to ensure that if it makes modifications to the opaque data, there are - * no side effects. - * - * @param pool to retrieve opaque data for. - * @return the opaque data for the pool. - */ -void *fr_connection_pool_get_opaque(fr_connection_pool_t *pool) -{ - return pool->opaque; -} - /** Mark connections for reconnection, and spawn at least 'start' connections * * This intended to be called on a connection pool that's in use, to have it reflect @@ -1284,8 +1270,6 @@ int fr_connection_pool_reconnect(fr_connection_pool_t *pool) * reconnection. */ pthread_mutex_lock(&pool->mutex); - for (this = pool->head; this; this = this->next) this->needs_reconnecting = true; - /* * We want to ensure at least 'start' connections * have been reconnected. We can't call reconnect @@ -1299,6 +1283,8 @@ int fr_connection_pool_reconnect(fr_connection_pool_t *pool) fr_connection_close_internal(pool, this); } + for (this = pool->head; this; this = this->next) this->needs_reconnecting = true; + pthread_mutex_unlock(&pool->mutex); now = time(NULL);