]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Constify cs in fr_connection_pool_init
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 26 Nov 2016 20:25:58 +0000 (15:25 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 26 Nov 2016 22:17:31 +0000 (17:17 -0500)
Even though it isn't... ugh

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

index 578ff3ed0a6b9c8b2882d17f45af6eed4881e2f9..2fd462d1ff91502b50647366cbe7d3d32d40dae7 100644 (file)
@@ -125,7 +125,7 @@ typedef int (*fr_connection_alive_t)(void *opaque, void *connection);
  *     Pool allocation/initialisation
  */
 fr_connection_pool_t   *fr_connection_pool_init(TALLOC_CTX *ctx,
-                                                CONF_SECTION *cs,
+                                                CONF_SECTION const *cs,
                                                 void *opaque,
                                                 fr_connection_create_t c,
                                                 fr_connection_alive_t a,
index 38367ee38f13f775d6307658474d5e723a3343aa..64c858744f9f8f73c8bdab11fbeb00eb84e76f36 100644 (file)
@@ -118,7 +118,7 @@ struct fr_connection_pool_t {
        pthread_cond_t  done_reconnecting;      //!< Before calling the create callback, threads should
                                                //!< block on this condition if reconnecting == true.
 
-       CONF_SECTION    *cs;                    //!< Configuration section holding the section of parsed
+       CONF_SECTION const *cs;                 //!< Configuration section holding the section of parsed
                                                //!< config file that relates to this pool.
        void            *opaque;                //!< Pointer to context data that will be passed to callbacks.
 
@@ -947,7 +947,7 @@ void fr_connection_pool_enable_triggers(fr_connection_pool_t *pool,
  *     - NULL on error.
  */
 fr_connection_pool_t *fr_connection_pool_init(TALLOC_CTX *ctx,
-                                             CONF_SECTION *cs,
+                                             CONF_SECTION const *cs,
                                              void *opaque,
                                              fr_connection_create_t c,
                                              fr_connection_alive_t a,
@@ -1040,7 +1040,13 @@ fr_connection_pool_t *fr_connection_pool_init(TALLOC_CTX *ctx,
 
        DEBUG2("Initialising connection pool");
 
-       if (cf_section_parse(cs, pool, connection_config) < 0) goto error;
+       {
+               CONF_SECTION *mutable;
+
+               memcpy(&mutable, &cs, sizeof(mutable));
+
+               if (cf_section_parse(mutable, pool, connection_config) < 0) goto error;
+       }
 
        /*
         *      Some simple limits