res_pjsip_outbound_registration: Fix leak on vector add failure.
[asterisk/asterisk.git] / res / res_odbc.c
index f89b59e..24f63a9 100644 (file)
@@ -48,8 +48,6 @@
 
 #include "asterisk.h"
 
-ASTERISK_REGISTER_FILE()
-
 #include "asterisk/file.h"
 #include "asterisk/channel.h"
 #include "asterisk/config.h"
@@ -63,7 +61,6 @@ ASTERISK_REGISTER_FILE()
 #include "asterisk/app.h"
 #include "asterisk/strings.h"
 #include "asterisk/threadstorage.h"
-#include "asterisk/data.h"
 
 struct odbc_class
 {
@@ -121,15 +118,6 @@ struct odbc_txn_frame {
        char name[0];                   /*!< Name of this transaction ID */
 };
 
-#define DATA_EXPORT_ODBC_CLASS(MEMBER)                         \
-       MEMBER(odbc_class, name, AST_DATA_STRING)               \
-       MEMBER(odbc_class, dsn, AST_DATA_STRING)                \
-       MEMBER(odbc_class, username, AST_DATA_STRING)           \
-       MEMBER(odbc_class, password, AST_DATA_PASSWORD)         \
-       MEMBER(odbc_class, forcecommit, AST_DATA_BOOLEAN)
-
-AST_DATA_STRUCTURE(odbc_class, DATA_EXPORT_ODBC_CLASS);
-
 const char *ast_odbc_isolation2text(int iso)
 {
        if (iso == SQL_TXN_READ_COMMITTED) {
@@ -523,7 +511,7 @@ static int load_odbc_config(void)
                                                !strncasecmp(v->name, "share", 5) ||
                                                !strcasecmp(v->name, "limit") ||
                                                !strcasecmp(v->name, "idlecheck")) {
-                                       ast_log(LOG_WARNING, "The 'pooling', 'shared_connections', 'limit', and 'idlecheck' options are deprecated. Please see UPGRADE.txt for information\n");
+                                       ast_log(LOG_WARNING, "The 'pooling', 'shared_connections', 'limit', and 'idlecheck' options were replaced by 'max_connections'.  See res_odbc.conf.sample.\n");
                                } else if (!strcasecmp(v->name, "enabled")) {
                                        enabled = ast_true(v->value);
                                } else if (!strcasecmp(v->name, "pre-connect")) {
@@ -973,65 +961,6 @@ static odbc_status odbc_obj_connect(struct odbc_obj *obj)
        return ODBC_SUCCESS;
 }
 
-/*!
- * \internal
- * \brief Implements the channels provider.
- */
-static int data_odbc_provider_handler(const struct ast_data_search *search,
-               struct ast_data *root)
-{
-       struct ao2_iterator aoi;
-       struct odbc_class *class;
-       struct ast_data *data_odbc_class, *data_odbc_connections;
-       struct ast_data *enum_node;
-
-       aoi = ao2_iterator_init(class_container, 0);
-       while ((class = ao2_iterator_next(&aoi))) {
-               data_odbc_class = ast_data_add_node(root, "class");
-               if (!data_odbc_class) {
-                       ao2_ref(class, -1);
-                       continue;
-               }
-
-               ast_data_add_structure(odbc_class, data_odbc_class, class);
-
-               data_odbc_connections = ast_data_add_node(data_odbc_class, "connections");
-               if (!data_odbc_connections) {
-                       ao2_ref(class, -1);
-                       continue;
-               }
-
-               /* isolation */
-               enum_node = ast_data_add_node(data_odbc_class, "isolation");
-               if (!enum_node) {
-                       ao2_ref(class, -1);
-                       continue;
-               }
-               ast_data_add_int(enum_node, "value", class->isolation);
-               ast_data_add_str(enum_node, "text", ast_odbc_isolation2text(class->isolation));
-               ao2_ref(class, -1);
-
-               if (!ast_data_search_match(search, data_odbc_class)) {
-                       ast_data_remove_node(root, data_odbc_class);
-               }
-       }
-       ao2_iterator_destroy(&aoi);
-       return 0;
-}
-
-/*!
- * \internal
- * \brief /asterisk/res/odbc/listprovider.
- */
-static const struct ast_data_handler odbc_provider = {
-       .version = AST_DATA_HANDLER_VERSION,
-       .get = data_odbc_provider_handler
-};
-
-static const struct ast_data_entry odbc_providers[] = {
-       AST_DATA_ENTRY("/asterisk/res/odbc", &odbc_provider),
-};
-
 static int reload(void)
 {
        struct odbc_cache_tables *table;
@@ -1089,7 +1018,6 @@ static int load_module(void)
        if (load_odbc_config() == -1)
                return AST_MODULE_LOAD_DECLINE;
        ast_cli_register_multiple(cli_odbc, ARRAY_LEN(cli_odbc));
-       ast_data_register_multiple(odbc_providers, ARRAY_LEN(odbc_providers));
        ast_log(LOG_NOTICE, "res_odbc loaded.\n");
        return 0;
 }