Revision
14426
Author
mikej
Date
2009-07-29 18:11:03 -0500 (Wed, 29 Jul 2009)

Log Message

fix build warnings

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (14425 => 14426)


--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	2009-07-29 22:48:43 UTC (rev 14425)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	2009-07-29 23:11:03 UTC (rev 14426)
@@ -596,7 +596,7 @@
 			for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
 				switch_hash_this(hi, NULL, NULL, &val);
 				profile = (mdl_profile_t *) val;
-				if (!strcmp(profile->extip, old_ip4)) {
+				if (old_ip4 && !strcmp(profile->extip, old_ip4)) {
 					tmp = profile->extip;
 					profile->extip = strdup(new_ip4);
 					switch_safe_free(tmp);
@@ -1989,15 +1989,15 @@
 		profile->name = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "message") && !switch_strlen_zero(val)) {
 		profile->message = switch_core_strdup(module_pool, val);
-	} else if (!strcasecmp(var, "local-network-acl")) {
+	} else if (!strcasecmp(var, "local-network-acl") && !switch_strlen_zero(val)) {
 		profile->local_network = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "rtp-ip")) {
 		profile->ip = switch_core_strdup(module_pool, strcasecmp(switch_str_nil(val), "auto") ? switch_str_nil(val) : globals.guess_ip);
 	} else if (!strcasecmp(var, "ext-rtp-ip")) {
 		char *ip = globals.guess_ip;
-		if (!strcasecmp(val, "auto-nat")) {
+		if (val && !strcasecmp(val, "auto-nat")) {
 			ip = globals.auto_nat ? switch_core_get_variable("nat_public_addr") : globals.guess_ip;
-		} else if (!strcasecmp(val, "auto")) {
+		} else if (val && !strcasecmp(val, "auto")) {
 			globals.auto_nat = 0;
 			ip = globals.guess_ip;
 		} else {

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c (14425 => 14426)


--- freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	2009-07-29 22:48:43 UTC (rev 14425)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	2009-07-29 23:11:03 UTC (rev 14426)
@@ -68,7 +68,7 @@
 
 struct peer_status {
 	switch_bool_t active;
-	int lastseen;
+	time_t lastseen;
 };
 
 SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_address, globals.address);
@@ -179,11 +179,12 @@
 	if (event->subclass_name && (!strcmp(event->subclass_name, MULTICAST_EVENT) ||
 				!strcmp(event->subclass_name, MULTICAST_PEERUP) ||
 				!strcmp(event->subclass_name, MULTICAST_PEERDOWN))) {
-		char * event_name;
-		if ((event_name = switch_event_get_header(event, "orig-event-name")) && !strcasecmp(event_name, "HEARTBEAT")) {
-			char *sender = switch_event_get_header(event, "orig-multicast-sender");
+		char * event_name, *sender;
+		if ((event_name = switch_event_get_header(event, "orig-event-name")) &&
+			!strcasecmp(event_name, "HEARTBEAT") && 
+			(sender = switch_event_get_header(event, "orig-multicast-sender"))) {
 			struct peer_status *p;
-			int now = switch_epoch_time_now(NULL);
+			time_t now = switch_epoch_time_now(NULL);
 			
 			if (!(p = switch_core_hash_find(globals.peer_hash, sender))) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Host %s not already in hash\n", sender);
@@ -200,7 +201,7 @@
 					char lastseen[21];
 					switch_event_add_header_string(local_event, SWITCH_STACK_BOTTOM, "Peer", sender);
 					if (p->lastseen) {
-						switch_snprintf(lastseen, sizeof(lastseen), "%d", p->lastseen);
+						switch_snprintf(lastseen, sizeof(lastseen), "%d", (int)p->lastseen);
 					} else {
 						switch_snprintf(lastseen, sizeof(lastseen), "%s", "Never");
 					}
@@ -243,7 +244,7 @@
 		switch_ssize_t keylen;
 		const void *key;
 		void *value;
-		int now = switch_epoch_time_now(NULL);
+		time_t now = switch_epoch_time_now(NULL);
 		struct peer_status *last;
 		char *host;
 		
@@ -258,7 +259,7 @@
 				if (switch_event_create_subclass(&local_event, SWITCH_EVENT_CUSTOM, MULTICAST_PEERDOWN) == SWITCH_STATUS_SUCCESS) {
 					char lastseen[21];
 					switch_event_add_header_string(local_event, SWITCH_STACK_BOTTOM, "Peer", host);
-					switch_snprintf(lastseen, sizeof(lastseen), "%d", last->lastseen);
+					switch_snprintf(lastseen, sizeof(lastseen), "%d", (int)last->lastseen);
 					switch_event_add_header_string(local_event, SWITCH_STACK_BOTTOM, "Lastseen", lastseen);
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Peer %s has gone down; last seen: %s\n", host, lastseen);
 
@@ -347,7 +348,7 @@
 	switch_ssize_t keylen;
 	const void *key;
 	void *value;
-	int now = switch_epoch_time_now(NULL);
+	time_t now = switch_epoch_time_now(NULL);
 	struct peer_status *last;
 	char *host;
 	int i = 0;