[Freeswitch-svn] [commit] r9014 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Mon Jul 14 10:55:04 EDT 2008


Author: mikej
Date: Mon Jul 14 10:55:03 2008
New Revision: 9014

Modified:
   freeswitch/trunk/src/switch_core.c
   freeswitch/trunk/src/switch_log.c

Log:
build tweaks for msvc

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Mon Jul 14 10:55:03 2008
@@ -937,29 +937,29 @@
 #endif
 				} else if (!strcasecmp(var, "colorize-console") && switch_true(val)) {
 					runtime.colorize_console = SWITCH_TRUE;
-				} else if (!strcasecmp(var, "mailer-app")) {
+				} else if (!strcasecmp(var, "mailer-app") && !switch_strlen_zero(val)) {
 					runtime.mailer_app = switch_core_strdup(runtime.memory_pool, val);
-				} else if (!strcasecmp(var, "mailer-app-args")) {
+				} else if (!strcasecmp(var, "mailer-app-args") && !switch_strlen_zero(val)) {
 					runtime.mailer_app_args = switch_core_strdup(runtime.memory_pool, val);
-				} else if (!strcasecmp(var, "sessions-per-second")) {
+				} else if (!strcasecmp(var, "sessions-per-second") && !switch_strlen_zero(val)) {
 					switch_core_sessions_per_second(atoi(val));
-				} else if (!strcasecmp(var, "max_dtmf_duration")) {
+				} else if (!strcasecmp(var, "max_dtmf_duration") && !switch_strlen_zero(val)) {
 					int tmp = atoi(val);
 					if (tmp > 0) {
 						switch_core_max_dtmf_duration((uint32_t) tmp);
 					}
-				} else if (!strcasecmp(var, "default_dtmf_duration")) {
+				} else if (!strcasecmp(var, "default_dtmf_duration") && !switch_strlen_zero(val)) {
 					int tmp = atoi(val);
 					if (tmp > 0) {
 						switch_core_default_dtmf_duration((uint32_t) tmp);
 					}
 				} else if (!strcasecmp(var, "disable-monotonic-timing")) {
 					switch_time_set_monotonic(SWITCH_FALSE);
-				} else if (!strcasecmp(var, "max-sessions")) {
+				} else if (!strcasecmp(var, "max-sessions") && !switch_strlen_zero(val)) {
 					switch_core_session_limit(atoi(val));
-				} else if (!strcasecmp(var, "rtp-start-port")) {
+				} else if (!strcasecmp(var, "rtp-start-port") && !switch_strlen_zero(val)) {
 					switch_rtp_set_start_port((switch_port_t) atoi(val));
-				} else if (!strcasecmp(var, "rtp-end-port")) {
+				} else if (!strcasecmp(var, "rtp-end-port") && !switch_strlen_zero(val)) {
 					switch_rtp_set_end_port((switch_port_t) atoi(val));
 				}
 			}

Modified: freeswitch/trunk/src/switch_log.c
==============================================================================
--- freeswitch/trunk/src/switch_log.c	(original)
+++ freeswitch/trunk/src/switch_log.c	Mon Jul 14 10:55:03 2008
@@ -259,6 +259,8 @@
 		return;
 	}
 
+	switch_assert(level < SWITCH_LOG_INVALID);
+
 	va_start(ap, fmt);
 
 	handle = switch_core_data_channel(channel);
@@ -333,8 +335,8 @@
 				if (COLORIZE) {
 
 #ifdef WIN32
-					SetConsoleTextAttribute(hStdout, COLORS[node->level]);
-					WriteFile(hStdout, node->data, (DWORD) strlen(node->data), NULL, NULL);
+					SetConsoleTextAttribute(hStdout, COLORS[level]);
+					WriteFile(hStdout, data, (DWORD) strlen(data), NULL, NULL);
 					SetConsoleTextAttribute(hStdout, wOldColorAttrs);
 #else
 					fprintf(handle, "%s%s%s", COLORS[level], data, SWITCH_SEQ_DEFAULT_COLOR);



More information about the Freeswitch-svn mailing list