]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove pool_get_opaque
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 27 Jun 2015 23:56:44 +0000 (19:56 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 27 Jun 2015 23:56:44 +0000 (19:56 -0400)
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.

src/include/connection.h
src/main/connection.c

index 951a6acba6e8849265ca8a02c230ec0f1dfd76c5..468d763873f108a10583661101135cf11c284766 100644 (file)
@@ -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
  */
index 4b44f30417f02cde8aaa38581c5e184c23c981c8..e48a1a34311d7db96f34c38f53c0e7e94c9a35d5 100644 (file)
@@ -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);