[Freeswitch-trunk] [commit] r12549 - freeswitch/trunk/src/mod/event_handlers/mod_erlang_event

FreeSWITCH SVN andrew at freeswitch.org
Tue Mar 10 12:06:20 PDT 2009


Author: andrew
Date: Tue Mar 10 14:06:19 2009
New Revision: 12549

Log:
Move some variable declarations to a more correct place


Modified:
   freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c

Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c	Tue Mar 10 14:06:19 2009
@@ -353,6 +353,11 @@
 	struct erlang_binding *ptr;
 	switch_uuid_t uuid;
 	char uuid_str[SWITCH_UUID_FORMATTED_LENGTH+1];
+	int type, size;
+	int i = 0;
+	void *p = NULL;
+	char *xmlstr;
+	ei_x_buff *rep;
 	ei_x_buff buf;
 	ei_x_new_with_version(&buf);
 
@@ -394,10 +399,6 @@
 	ei_sendto(ptr->listener->ec, ptr->listener->sockfd, &ptr->process, &buf);
 	switch_mutex_unlock(ptr->listener->sock_mutex);
 
-	int i = 0;
-	ei_x_buff *rep;
-	void *p = NULL;
-
 	while (!(p = switch_core_hash_find(ptr->listener->fetch_reply_hash, uuid_str)) || p == &globals.WAITING) {
 		if (i > 50) { /* half a second timeout */
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Timed out when waiting for XML fetch response\n");
@@ -409,14 +410,12 @@
 	}
 
 	rep = (ei_x_buff *) p;
-	int type, size;
 
 	ei_get_type(rep->buff, &rep->index, &type, &size);
 
 	if (type != ERL_STRING_EXT && type != ERL_BINARY_EXT) /* XXX no unicode or character codes > 255 */
 		return NULL;
 
-	char *xmlstr;
 	
 	if (!(xmlstr = malloc(size + 1))) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error\n");



More information about the Freeswitch-trunk mailing list