[asterisk-commits] branch mogorman/asterisk-xmpp r21033 - /team/mogorman/asterisk-xmpp/res/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Apr 17 12:29:45 MST 2006


Author: mogorman
Date: Mon Apr 17 14:29:44 2006
New Revision: 21033

URL: http://svn.digium.com/view/asterisk?rev=21033&view=rev
Log:
no message

Modified:
    team/mogorman/asterisk-xmpp/res/res_jabber.c

Modified: team/mogorman/asterisk-xmpp/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/res/res_jabber.c?rev=21033&r1=21032&r2=21033&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/res/res_jabber.c (original)
+++ team/mogorman/asterisk-xmpp/res/res_jabber.c Mon Apr 17 14:29:44 2006
@@ -788,7 +788,7 @@
  */
 static void aji_handle_iq(struct aji_client *client, iks *node)
 {
-	ast_verbose("MWAHHAHAHA NOTHING TO SEE HERE!\n");
+	if(option_verbose > 77) ast_verbose("MWAHHAHAHA NOTHING TO SEE HERE!\n");
 }
 
 
@@ -1304,13 +1304,15 @@
 	} else {
 		client->jid = iks_id_new(client->stack,client->user);
 	}
-
 	connected = iks_connect_via(client->p, client->serverhost, client->port, client->server);
-
-	if(connected== IKS_NET_NOCONN)
-		ast_log(LOG_ERROR, "JABBER ERROR: No Connection");
-	if(connected == IKS_NET_NODNS)
-		ast_log(LOG_ERROR, "JABBER ERROR: No DNS");
+	if(connected== IKS_NET_NOCONN) {
+		ast_log(LOG_ERROR, "JABBER ERROR: No Connection\n");
+		goto failed;
+	}
+	if(connected == IKS_NET_NODNS) {
+		ast_log(LOG_ERROR, "JABBER ERROR: No DNS\n");
+		goto failed;
+	}
 	return 1;
 
 failedfilter:
@@ -1707,7 +1709,7 @@
 
 static int load_module(void *mod)
 {
-
+	int res = 0;
 
 	if(!aji_load_config()) {
 		ast_log(LOG_ERROR, "JABBER: Failed to load\n");
@@ -1718,13 +1720,14 @@
 			switch (iterator->component){
 				
 				case AJI_COMPONENT:
-						aji_component_initialize(iterator);
+						res = aji_component_initialize(iterator);
 						break;
 				case AJI_CLIENT:
-						aji_client_initialize(iterator);
+						res = aji_client_initialize(iterator);
 						break;
 			}
-			ast_pthread_create(&iterator->thread, NULL, aji_recv_loop, iterator);
+			if(res != -1)
+				ast_pthread_create(&iterator->thread, NULL, aji_recv_loop, iterator);
 			ASTOBJ_UNLOCK(iterator);
 			});
 		ast_register_application(app_ajisend, aji_send_exec, ajisend_synopsis, ajisend_descrip);



More information about the asterisk-commits mailing list