[asterisk-commits] branch oej/res_config_ldap r30493 - /team/oej/res_config_ldap/res/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu May 25 20:33:25 MST 2006


Author: russell
Date: Thu May 25 22:33:24 2006
New Revision: 30493

URL: http://svn.digium.com/view/asterisk?rev=30493&view=rev
Log:
remove a bunch of debug code

Modified:
    team/oej/res_config_ldap/res/res_config_ldap.c

Modified: team/oej/res_config_ldap/res/res_config_ldap.c
URL: http://svn.digium.com/view/asterisk/team/oej/res_config_ldap/res/res_config_ldap.c?rev=30493&r1=30492&r2=30493&view=diff
==============================================================================
--- team/oej/res_config_ldap/res/res_config_ldap.c (original)
+++ team/oej/res_config_ldap/res/res_config_ldap.c Thu May 25 22:33:24 2006
@@ -4,8 +4,6 @@
  * Copyright (C) 2005, Oxymium sarl
  * 
  * Manuel Guesdon <mguesdon at oxymium.net> - LDAP RealTime Driver Author/Adaptor
- *
- * res_config_ldap.c <LDAP plugin for RealTime configuration engine>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -27,9 +25,6 @@
  * \author Manuel Guesdon
  *
  * \arg http://www.openldap.org
- * \par	Version notes
- * - v0.5   - (11-16-2005) - Initial version based
- * - v0.7   - (03-08-2006) - Fixes, confg file changes
  */
 
 /*** MODULEINFO
@@ -39,8 +34,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <stdio.h>
 #include <ldap.h>
-#include <stdio.h>
 
 #include "asterisk.h"
 
@@ -86,42 +81,9 @@
 	"       Shows connection information for the LDAP RealTime driver\n";
 
 static struct ast_cli_entry cli_realtime_ldap_status = {
-	{"realtime", "ldap", "status", NULL}, realtime_ldap_status,
+	{ "realtime", "ldap", "status", NULL }, realtime_ldap_status,
 	"Shows connection information for the LDAP RealTime driver",
-		cli_realtime_ldap_status_usage, NULL
-};
-
-/*! \brief Log variable */
-static void ast_variable_log(const char *log_prefix, struct ast_variable *var)
-{
-	if (!option_debug)
-		return;
-	ast_log(LOG_DEBUG, "LOG Variable: %s\n", log_prefix);
-	while (var) {
-		ast_log(LOG_DEBUG, "%s => %s\n", var->name, var->value);
-		var = var->next;
-	};
-	if (option_debug > 1)
-		ast_log(LOG_DEBUG, "END LOG Variable: %s\n", log_prefix);
-}
-
-/*! \brief Log config (only executed if option_debug is set) */
-static void ast_config_log(const char *log_prefix, struct ast_config *config)
-{
-	char *category_name = NULL;
-
-	ast_log(LOG_DEBUG, "LOG Config: %s\n", log_prefix);
-	while ((category_name = ast_category_browse(config, category_name))) {
-		ast_log(LOG_DEBUG, "========= category: %s ==========\n", category_name);
-		struct ast_variable *var = ast_variable_browse(config, category_name);
-		if (var) {
-			while (var) {
-				ast_log(LOG_DEBUG, "%s=%s\n", var->name, var->value);
-				var = var->next;
-			}
-		}
-	}
-	ast_log(LOG_DEBUG, "END LOG Config: %s\n", log_prefix);
+	cli_realtime_ldap_status_usage, NULL
 };
 
 /*! \brief Table configuration */
@@ -154,9 +116,9 @@
 			return c;
 		else
 			c = c->next;
-	};
+	}
 	return NULL;
-};
+}
 
 /*! \brief add attribute to table config - Should be locked before using it */
 static void ldap_table_config_add_attribute(struct ldap_table_config *table_config,
@@ -210,9 +172,9 @@
 					ast_log(LOG_DEBUG, "LDAP RealTime (%d): Added attribute in %s: %s -> %s\n",
 						__LINE__, table_config->table_name, start, value);
 			}
-		};
+		}
 		free(string);
-	};
+	}
 };
 
 /*! \brief Free table_config */
@@ -423,7 +385,6 @@
 		}
 		ldap_msgfree(ldap_result);
 
-		ast_variable_log("LDAP RealTime: Found Entry", var);
 		return var;
 	}
 }
@@ -678,11 +639,8 @@
 
 						for (entry_index = 0; ldap_entry; entry_index++) {
 							vars[entry_index] = realtime_ldap_entry_to_var(table_config,ldap_entry);
-							ast_variable_log("LDAP RealTime: Found Entry", vars[entry_index]);
 							ldap_entry = ldap_next_entry(ldapConn, ldap_entry);
-							if (option_debug)
-								ast_log(LOG_DEBUG, "LDAP RealTime (%d): next entry: %p\n", __LINE__, ldap_entry);
-						};
+						}
 					} else {
 						ast_log(LOG_WARNING, "LDAP RealTime: Could not find any entry matching %s in base dn %s.\n",
 							filter, clean_basedn);
@@ -698,10 +656,6 @@
 							while (tmp) {
 								if (strcasecmp(tmp->name, "accountBaseDN") == 0) {
 									struct ast_variable *base_var = ldap_loadentry(table_config, tmp->value);
-									if (option_debug)
-										ast_log(LOG_DEBUG, "LDAP RealTime (%d): Loaded base: %s\n",
-												__LINE__, tmp->value);
-									ast_variable_log("Base Variables", base_var);
 									while (base_var) {
 										struct ast_variable *next = base_var->next;
 										struct ast_variable *test_var = *p;
@@ -725,7 +679,7 @@
 												base_var->next = NULL;
 											append_var = base_var;
 											base_var = next;
-										};
+										}
 									}
 								}
 								if (!tmp->next && append_var) {
@@ -766,9 +720,6 @@
 static struct ast_variable *realtime_ldap(const char *basedn,
 					  const char *table_name, va_list ap)
 {
-	if (option_debug)
-		ast_log(LOG_DEBUG, "LDAP RealTime (%d): realtime_ldap: basedn: %s table_name: %s\n",
-			__LINE__, basedn, table_name);
 	struct ast_variable **vars = realtime_ldap_base(NULL, basedn, table_name, ap);
 	struct ast_variable *var = NULL;
 
@@ -788,7 +739,6 @@
 		}
 		free(vars);
 	}
-	ast_variable_log("LDAP RealTime: ==> Found Entry", var);
 	return var;
 }
 
@@ -796,9 +746,6 @@
 static struct ast_config *realtime_multi_ldap(const char *basedn,
       const char *table_name, va_list ap)
 {
-	if (option_debug)
-		ast_log(LOG_DEBUG, "LDAP RealTime (%d): realtime_multi_ldap: basedn: %s table_name: %s\n",
-			__LINE__, basedn, table_name);
 	struct ast_variable **vars =
 		realtime_ldap_base(NULL, basedn, table_name, ap);
 	struct ast_config *cfg = NULL;
@@ -958,8 +905,6 @@
 			ast_log(LOG_WARNING, "LDAP RealTime: Could not find config '%s' in database.\n", file);
 		}
 	}
-	if (option_debug)
-		ast_config_log("LDAP RealTime: Configuration", cfg);
 	return cfg;
 
 }



More information about the asterisk-commits mailing list