[asterisk-commits] russell: branch 1.8 r317474 - in /branches/1.8: cdr/ cel/ channels/ channels/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 5 17:36:39 CDT 2011


Author: russell
Date: Thu May  5 17:36:33 2011
New Revision: 317474

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=317474
Log:
Fix more "set but unused" warnings.

Modified:
    branches/1.8/cdr/cdr_radius.c
    branches/1.8/cel/cel_pgsql.c
    branches/1.8/channels/chan_console.c
    branches/1.8/channels/chan_iax2.c
    branches/1.8/channels/chan_jingle.c
    branches/1.8/channels/chan_sip.c
    branches/1.8/channels/iax2-provision.c
    branches/1.8/channels/sip/sdp_crypto.c
    branches/1.8/pbx/pbx_dundi.c
    branches/1.8/pbx/pbx_lua.c
    branches/1.8/res/res_config_odbc.c
    branches/1.8/res/res_config_sqlite.c
    branches/1.8/res/res_crypto.c
    branches/1.8/res/res_jabber.c

Modified: branches/1.8/cdr/cdr_radius.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/cdr/cdr_radius.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/cdr/cdr_radius.c (original)
+++ branches/1.8/cdr/cdr_radius.c Thu May  5 17:36:33 2011
@@ -231,7 +231,6 @@
 {
 	struct ast_config *cfg;
 	struct ast_flags config_flags = { 0 };
-	int res;
 	const char *tmp;
 
 	if ((cfg = ast_config_load(cdr_config, config_flags)) && cfg != CONFIG_STATUS_FILEINVALID) {
@@ -259,7 +258,7 @@
 		return AST_MODULE_LOAD_DECLINE;
 	}
 
-	res = ast_cdr_register(name, desc, radius_log);
+	ast_cdr_register(name, desc, radius_log);
 	return AST_MODULE_LOAD_SUCCESS;
 }
 

Modified: branches/1.8/cel/cel_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/cel/cel_pgsql.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/cel/cel_pgsql.c (original)
+++ branches/1.8/cel/cel_pgsql.c Thu May  5 17:36:33 2011
@@ -535,7 +535,6 @@
 static int my_load_module(int reload)
 {
 	struct ast_config *cfg;
-	int res;
 	struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
 
 	if ((cfg = ast_config_load(config, config_flags)) == NULL || cfg == CONFIG_STATUS_FILEINVALID) {
@@ -545,7 +544,7 @@
 		return AST_MODULE_LOAD_SUCCESS;
 	}
 
-	res = process_my_load_module(cfg);
+	process_my_load_module(cfg);
 	ast_config_destroy(cfg);
 
 	event_sub = ast_event_subscribe(AST_EVENT_CEL, pgsql_log, "CEL PGSQL backend", NULL, AST_EVENT_IE_END);

Modified: branches/1.8/channels/chan_console.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_console.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/channels/chan_console.c (original)
+++ branches/1.8/channels/chan_console.c Thu May  5 17:36:33 2011
@@ -733,7 +733,7 @@
 
 	unref_pvt(pvt);
 
-	return CLI_SUCCESS;
+	return res;
 }
 
 static char *cli_console_flash(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)

Modified: branches/1.8/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_iax2.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/channels/chan_iax2.c (original)
+++ branches/1.8/channels/chan_iax2.c Thu May  5 17:36:33 2011
@@ -6059,7 +6059,6 @@
 	struct iax2_trunk_peer *tpeer;
 	void *tmp, *ptr;
 	struct timeval now;
-	int res; 
 	struct ast_iax2_meta_trunk_entry *met;
 	struct ast_iax2_meta_trunk_mini *mtm;
 
@@ -6115,7 +6114,7 @@
 		/* if we have enough for a full MTU, ship it now without waiting */
 		if (global_max_trunk_mtu > 0 && tpeer->trunkdatalen + f->datalen + 4 >= global_max_trunk_mtu) {
 			now = ast_tvnow();
-			res = send_trunk(tpeer, &now); 
+			send_trunk(tpeer, &now); 
 			trunk_untimed ++; 
 		}
 
@@ -9247,7 +9246,6 @@
 	struct iax_dual *d;
 	struct ast_frame *f;
 	int ext;
-	int res;
 	d = stuff;
 	chan1 = d->chan1;
 	chan2 = d->chan2;
@@ -9255,7 +9253,7 @@
 	f = ast_read(chan1);
 	if (f)
 		ast_frfree(f);
-	res = ast_park_call(chan1, chan2, 0, d->parkexten, &ext);
+	ast_park_call(chan1, chan2, 0, d->parkexten, &ext);
 	ast_hangup(chan2);
 	ast_log(LOG_NOTICE, "Parked on extension '%d'\n", ext);
 	return NULL;

Modified: branches/1.8/channels/chan_jingle.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_jingle.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/channels/chan_jingle.c (original)
+++ branches/1.8/channels/chan_jingle.c Thu May  5 17:36:33 2011
@@ -584,7 +584,6 @@
 	struct ast_sockaddr sin_tmp;
 	struct ast_sockaddr us_tmp;
 	struct ast_sockaddr bindaddr_tmp;
-	struct sockaddr_in dest;
 	struct in_addr us;
 	struct in_addr externaddr;
 	iks *iq, *jingle, *content, *transport, *candidate;
@@ -665,9 +664,6 @@
 		ours2 = NULL;
 	}
 	ours1 = NULL;
-	dest.sin_addr = __ourip;
-	dest.sin_port = sin.sin_port;
-
 
 	for (tmp = p->ourcandidates; tmp; tmp = tmp->next) {
 		snprintf(component, sizeof(component), "%u", tmp->component);

Modified: branches/1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_sip.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/channels/chan_sip.c (original)
+++ branches/1.8/channels/chan_sip.c Thu May  5 17:36:33 2011
@@ -4553,7 +4553,6 @@
 	struct ast_config *peerlist = NULL;
 	char ipaddr[INET6_ADDRSTRLEN];
 	char portstring[6]; /*up to 5 digits plus null terminator*/
-	char *cat = NULL;
 	int realtimeregs = ast_check_realtime("sipregs");
 
 	/* First check on peer name */
@@ -4625,7 +4624,6 @@
 					}
 				} else { /*var wasn't found in the list of "hosts", so try "ipaddr"*/
 					peerlist = NULL;
-					cat = NULL;
 					peerlist = ast_load_realtime_multientry("sippeers", "ipaddr", ipaddr, SENTINEL);
 					if(peerlist) {
 						var = get_insecure_variable_from_config(peerlist);
@@ -12476,7 +12474,6 @@
 	/* if we are here, our registration timed out, so we'll just do it over */
 	struct sip_registry *r = (struct sip_registry *)data; /* the ref count should have been bumped when the sched item was added */
 	struct sip_pvt *p;
-	int res;
 
 	/* if we couldn't get a reference to the registry object, punt */
 	if (!r) {
@@ -12519,7 +12516,7 @@
 		r->regstate = REG_STATE_FAILED;
 	} else {
 		r->regstate = REG_STATE_UNREGISTERED;
-		res = transmit_register(r, SIP_REGISTER, NULL, NULL);
+		transmit_register(r, SIP_REGISTER, NULL, NULL);
 		ast_log(LOG_NOTICE, "   -- Registration for '%s@%s' timed out, trying again (Attempt #%d)\n", r->username, r->hostname, r->regattempts);
 	}
 	manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: SIP\r\nUsername: %s\r\nDomain: %s\r\nStatus: %s\r\n", r->username, r->hostname, regstate2str(r->regstate));
@@ -12800,8 +12797,6 @@
 	const char *of;
 	char *c;
 	char referto[256];
-	char *ttag, *ftag;
-	char *theirtag = ast_strdupa(p->theirtag);
 	int	use_tls=FALSE;
 
 	if (sipdebug) {
@@ -12811,12 +12806,8 @@
 	/* Are we transfering an inbound or outbound call ? */
 	if (ast_test_flag(&p->flags[0], SIP_OUTGOING))  {
 		of = get_header(&p->initreq, "To");
-		ttag = theirtag;
-		ftag = p->tag;
 	} else {
 		of = get_header(&p->initreq, "From");
-		ftag = theirtag;
-		ttag = p->tag;
 	}
 
 	ast_copy_string(from, of, sizeof(from));
@@ -19936,7 +19927,6 @@
 {
 	struct ast_channel *owner;
 	int sipmethod;
-	int res = 1;
 	const char *c = get_header(req, "Cseq");
 	/* GCC 4.2 complains if I try to cast c as a char * when passing it to ast_skip_nonblanks, so make a copy of it */
 	char *c_copy = ast_strdupa(c);
@@ -20059,7 +20049,7 @@
 			} else if (sipmethod == SIP_NOTIFY) {
 				handle_response_notify(p, resp, rest, req, seqno);
 			} else if (sipmethod == SIP_REGISTER) {
-				res = handle_response_register(p, resp, rest, req, seqno);
+				handle_response_register(p, resp, rest, req, seqno);
 			} else if (sipmethod == SIP_SUBSCRIBE) {
 				ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
 				handle_response_subscribe(p, resp, rest, req, seqno);
@@ -20077,7 +20067,7 @@
 			else if (sipmethod == SIP_SUBSCRIBE)
 				handle_response_subscribe(p, resp, rest, req, seqno);
 			else if (p->registry && sipmethod == SIP_REGISTER)
-				res = handle_response_register(p, resp, rest, req, seqno);
+				handle_response_register(p, resp, rest, req, seqno);
 			else if (sipmethod == SIP_UPDATE) {
 				handle_response_update(p, resp, rest, req, seqno);
 			} else if (sipmethod == SIP_BYE) {
@@ -20102,7 +20092,7 @@
 			else if (sipmethod == SIP_SUBSCRIBE)
 				handle_response_subscribe(p, resp, rest, req, seqno);
 			else if (p->registry && sipmethod == SIP_REGISTER)
-				res = handle_response_register(p, resp, rest, req, seqno);
+				handle_response_register(p, resp, rest, req, seqno);
 			else {
 				ast_log(LOG_WARNING, "Forbidden - maybe wrong password on authentication for %s\n", msg);
 				pvt_set_needdestroy(p, "received 403 response");
@@ -20110,7 +20100,7 @@
 			break;
 		case 404: /* Not found */
 			if (p->registry && sipmethod == SIP_REGISTER)
-				res = handle_response_register(p, resp, rest, req, seqno);
+				handle_response_register(p, resp, rest, req, seqno);
 			else if (sipmethod == SIP_INVITE)
 				handle_response_invite(p, resp, rest, req, seqno);
 			else if (sipmethod == SIP_SUBSCRIBE)
@@ -20120,13 +20110,13 @@
 			break;
 		case 423: /* Interval too brief */
 			if (sipmethod == SIP_REGISTER)
-				res = handle_response_register(p, resp, rest, req, seqno);
+				handle_response_register(p, resp, rest, req, seqno);
 			break;
 		case 408: /* Request timeout - terminate dialog */
 			if (sipmethod == SIP_INVITE)
 				handle_response_invite(p, resp, rest, req, seqno);
 			else if (sipmethod == SIP_REGISTER)
-				res = handle_response_register(p, resp, rest, req, seqno);
+				handle_response_register(p, resp, rest, req, seqno);
 			else if (sipmethod == SIP_BYE) {
 				pvt_set_needdestroy(p, "received 408 response");
 				ast_debug(4, "Got timeout on bye. Thanks for the answer. Now, kill this call\n");
@@ -20726,12 +20716,10 @@
 	/* Mostly created to return proper answers on notifications on outbound REFER's */
 	int res = 0;
 	const char *event = get_header(req, "Event");
-	char *eventid = NULL;
 	char *sep;
 
 	if( (sep = strchr(event, ';')) ) {	/* XXX bug here - overwriting string ? */
 		*sep++ = '\0';
-		eventid = sep;
 	}
 	
 	if (sipdebug)

Modified: branches/1.8/channels/iax2-provision.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/iax2-provision.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/channels/iax2-provision.c (original)
+++ branches/1.8/channels/iax2-provision.c Thu May  5 17:36:33 2011
@@ -110,7 +110,6 @@
 {
 	int x;
 	int len;
-	int found;
 	unsigned int flags = 0;
 	char *e;
 	while(buf && *buf) {
@@ -119,7 +118,6 @@
 			len = e - buf;
 		else
 			len = 0;
-		found = 0;
 		for (x = 0; x < ARRAY_LEN(iax_flags); x++) {
 			if ((len && !strncasecmp(iax_flags[x].name, buf, len)) ||
 			    (!len && !strcasecmp(iax_flags[x].name, buf))) {

Modified: branches/1.8/channels/sip/sdp_crypto.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sip/sdp_crypto.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/channels/sip/sdp_crypto.c (original)
+++ branches/1.8/channels/sip/sdp_crypto.c Thu May  5 17:36:33 2011
@@ -191,7 +191,6 @@
 int sdp_crypto_process(struct sdp_crypto *p, const char *attr, struct ast_rtp_instance *rtp)
 {
 	char *str = NULL;
-	char *name = NULL;
 	char *tag = NULL;
 	char *suite = NULL;
 	char *key_params = NULL;
@@ -211,7 +210,7 @@
 
 	str = ast_strdupa(attr);
 
-	name = strsep(&str, ":");
+	strsep(&str, ":");
 	tag = strsep(&str, " ");
 	suite = strsep(&str, " ");
 	key_params = strsep(&str, " ");

Modified: branches/1.8/pbx/pbx_dundi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/pbx/pbx_dundi.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/pbx/pbx_dundi.c (original)
+++ branches/1.8/pbx/pbx_dundi.c Thu May  5 17:36:33 2011
@@ -2603,6 +2603,7 @@
 		}
 		ast_cli(a->fd, "Peer:    %s\n", ast_eid_to_str(eid_str, sizeof(eid_str), &peer->eid));
 		ast_cli(a->fd, "Model:   %s\n", model2str(peer->model));
+		ast_cli(a->fd, "Order:   %s\n", order);
 		ast_cli(a->fd, "Host:    %s\n", peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "<Unspecified>");
 		ast_cli(a->fd, "Port:    %d\n", ntohs(peer->addr.sin_port));
 		ast_cli(a->fd, "Dynamic: %s\n", peer->dynamic ? "yes" : "no");

Modified: branches/1.8/pbx/pbx_lua.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/pbx/pbx_lua.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/pbx/pbx_lua.c (original)
+++ branches/1.8/pbx/pbx_lua.c Thu May  5 17:36:33 2011
@@ -1343,12 +1343,12 @@
 	
 	/* step through the extensions looking for a match */
 	for (i = 1; i < lua_objlen(L, context_order_table) + 1; i++) {
-		int e_index, e_index_copy, match = 0;
+		int e_index_copy, match = 0;
 		const char *e;
 
 		lua_pushinteger(L, i);
 		lua_gettable(L, context_order_table);
-		e_index = lua_gettop(L);
+		lua_gettop(L);
 
 		/* copy the key at the top of the stack for use later */
 		lua_pushvalue(L, -1);

Modified: branches/1.8/res/res_config_odbc.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_config_odbc.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/res/res_config_odbc.c (original)
+++ branches/1.8/res/res_config_odbc.c Thu May  5 17:36:33 2011
@@ -151,7 +151,7 @@
 	char coltitle[256];
 	char rowdata[2048];
 	char *op;
-	const char *newparam, *newval;
+	const char *newparam;
 	char *stringp;
 	char *chunk;
 	SQLSMALLINT collen;
@@ -193,7 +193,7 @@
 		ast_string_field_free_memory(&cps);
 		return NULL;
 	}
-	newval = va_arg(aq, const char *);
+	va_arg(aq, const char *);
 	op = !strchr(newparam, ' ') ? " =" : "";
 	snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE %s%s ?%s", table, newparam, op,
 		strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : "");
@@ -201,7 +201,7 @@
 		op = !strchr(newparam, ' ') ? " =" : "";
 		snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " AND %s%s ?%s", newparam, op,
 			strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : "");
-		newval = va_arg(aq, const char *);
+		va_arg(aq, const char *);
 	}
 	va_end(aq);
 
@@ -317,7 +317,7 @@
 	char rowdata[2048];
 	const char *initfield=NULL;
 	char *op;
-	const char *newparam, *newval;
+	const char *newparam;
 	char *stringp;
 	char *chunk;
 	SQLSMALLINT collen;
@@ -358,7 +358,7 @@
 	initfield = ast_strdupa(newparam);
 	if ((op = strchr(initfield, ' '))) 
 		*op = '\0';
-	newval = va_arg(aq, const char *);
+	va_arg(aq, const char *);
 	op = !strchr(newparam, ' ') ? " =" : "";
 	snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE %s%s ?%s", table, newparam, op,
 		strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : "");
@@ -366,7 +366,7 @@
 		op = !strchr(newparam, ' ') ? " =" : "";
 		snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " AND %s%s ?%s", newparam, op,
 			strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : "");
-		newval = va_arg(aq, const char *);
+		va_arg(aq, const char *);
 	}
 	if (initfield)
 		snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ORDER BY %s", initfield);
@@ -476,7 +476,7 @@
 	SQLHSTMT stmt;
 	char sql[256];
 	SQLLEN rowcount=0;
-	const char *newparam, *newval;
+	const char *newparam;
 	int res, count = 1;
 	va_list aq;
 	struct custom_prepare_struct cps = { .sql = sql, .extra = lookup };
@@ -509,7 +509,7 @@
 		ast_string_field_free_memory(&cps);
 		return -1;
 	}
-	newval = va_arg(aq, const char *);
+	va_arg(aq, const char *);
 
 	if (tableptr && !(column = ast_odbc_find_column(tableptr, newparam))) {
 		ast_log(LOG_WARNING, "Key field '%s' does not exist in table '%s@%s'.  Update will fail\n", newparam, table, database);
@@ -517,7 +517,7 @@
 
 	snprintf(sql, sizeof(sql), "UPDATE %s SET %s=?", table, newparam);
 	while((newparam = va_arg(aq, const char *))) {
-		newval = va_arg(aq, const char *);
+		va_arg(aq, const char *);
 		if ((tableptr && (column = ast_odbc_find_column(tableptr, newparam))) || count > 63) {
 			snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), ", %s=?", newparam);
 		} else { /* the column does not exist in the table */
@@ -716,7 +716,7 @@
 	char keys[256];
 	char vals[256];
 	SQLLEN rowcount=0;
-	const char *newparam, *newval;
+	const char *newparam;
 	int res;
 	va_list aq;
 	struct custom_prepare_struct cps = { .sql = sql, .extra = NULL };
@@ -737,13 +737,13 @@
 		ast_odbc_release_obj(obj);
 		return -1;
 	}
-	newval = va_arg(aq, const char *);
+	va_arg(aq, const char *);
 	snprintf(keys, sizeof(keys), "%s", newparam);
 	ast_copy_string(vals, "?", sizeof(vals));
 	while ((newparam = va_arg(aq, const char *))) {
 		snprintf(keys + strlen(keys), sizeof(keys) - strlen(keys), ", %s", newparam);
 		snprintf(vals + strlen(vals), sizeof(vals) - strlen(vals), ", ?");
-		newval = va_arg(aq, const char *);
+		va_arg(aq, const char *);
 	}
 	va_end(aq);
 	snprintf(sql, sizeof(sql), "INSERT INTO %s (%s) VALUES (%s)", table, keys, vals);
@@ -791,7 +791,7 @@
 	SQLHSTMT stmt;
 	char sql[256];
 	SQLLEN rowcount=0;
-	const char *newparam, *newval;
+	const char *newparam;
 	int res;
 	va_list aq;
 	struct custom_prepare_struct cps = { .sql = sql, .extra = lookup };
@@ -810,7 +810,7 @@
 	snprintf(sql, sizeof(sql), "DELETE FROM %s WHERE ", table);
 	while((newparam = va_arg(aq, const char *))) {
 		snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), "%s=? AND ", newparam);
-		newval = va_arg(aq, const char *);
+		va_arg(aq, const char *);
 	}
 	va_end(aq);
 	snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), "%s=?", keyfield);

Modified: branches/1.8/res/res_config_sqlite.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_config_sqlite.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/res/res_config_sqlite.c (original)
+++ branches/1.8/res/res_config_sqlite.c Thu May  5 17:36:33 2011
@@ -1618,7 +1618,7 @@
 	struct sqlite_cache_tables *tbl = find_table(tablename);
 	struct sqlite_cache_columns *col;
 	char *elm;
-	int type, size, res = 0;
+	int type, res = 0;
 
 	if (!tbl) {
 		return -1;
@@ -1626,7 +1626,7 @@
 
 	while ((elm = va_arg(ap, char *))) {
 		type = va_arg(ap, require_type);
-		size = va_arg(ap, int);
+		va_arg(ap, int);
 		/* Check if the field matches the criteria */
 		AST_RWLIST_TRAVERSE(&tbl->columns, col, list) {
 			if (strcmp(col->name, elm) == 0) {

Modified: branches/1.8/res/res_crypto.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_crypto.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/res/res_crypto.c (original)
+++ branches/1.8/res/res_crypto.c Thu May  5 17:36:33 2011
@@ -99,7 +99,8 @@
 {
 	struct ast_key *key = (struct ast_key *)userdata;
 	char prompt[256];
-	int res, tmp;
+	int tmp;
+	int res;
 
 	if (key->infd < 0) {
 		/* Note that we were at least called */
@@ -118,6 +119,9 @@
 	tmp = ast_hide_password(key->infd);
 	memset(buf, 0, size);
 	res = read(key->infd, buf, size);
+	if (res == -1) {
+		ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno));
+	}
 	ast_restore_tty(key->infd, tmp);
 	if (buf[strlen(buf) -1] == '\n') {
 		buf[strlen(buf) - 1] = '\0';

Modified: branches/1.8/res/res_jabber.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_jabber.c?view=diff&rev=317474&r1=317473&r2=317474
==============================================================================
--- branches/1.8/res/res_jabber.c (original)
+++ branches/1.8/res/res_jabber.c Thu May  5 17:36:33 2011
@@ -2873,7 +2873,6 @@
  */
 static void aji_pruneregister(struct aji_client *client)
 {
-	int res = 0;
 	iks *removeiq = iks_new("iq");
 	iks *removequery = iks_new("query");
 	iks *removeitem = iks_new("item");
@@ -2890,10 +2889,10 @@
 		/* For an aji_buddy, both AUTOPRUNE and AUTOREGISTER will never
 		 * be called at the same time */
 		if (ast_test_flag(&iterator->flags, AJI_AUTOPRUNE)) { /* If autoprune is set on jabber.conf */
-			res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBE, iterator->name,
+			ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBE, iterator->name,
 								 "GoodBye. Your status is no longer needed by Asterisk the Open Source PBX"
 								 " so I am no longer subscribing to your presence.\n"));
-			res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBED, iterator->name,
+			ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBED, iterator->name,
 								 "GoodBye.  You are no longer in the Asterisk config file so I am removing"
 								 " your access to my presence.\n"));
 			iks_insert_attrib(removeiq, "from", client->jid->full);
@@ -2901,9 +2900,9 @@
 			iks_insert_attrib(removequery, "xmlns", "jabber:iq:roster");
 			iks_insert_attrib(removeitem, "jid", iterator->name);
 			iks_insert_attrib(removeitem, "subscription", "remove");
-			res = ast_aji_send(client, removeiq);
+			ast_aji_send(client, removeiq);
 		} else if (ast_test_flag(&iterator->flags, AJI_AUTOREGISTER)) {
-			res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_SUBSCRIBE, iterator->name,
+			ast_aji_send(client, iks_make_s10n(IKS_TYPE_SUBSCRIBE, iterator->name,
 								 "Greetings! I am the Asterisk Open Source PBX and I want to subscribe to your presence\n"));
 			ast_clear_flag(&iterator->flags, AJI_AUTOREGISTER);
 		}
@@ -3287,7 +3286,6 @@
  */
 static void aji_create_affiliations(struct aji_client *client, const char *node)
 {
-	int res = 0;
 	iks *modify_affiliates = aji_pubsub_iq_create(client, "set");
 	iks *pubsub, *affiliations, *affiliate;
 	pubsub = iks_insert(modify_affiliates, "pubsub");
@@ -3301,7 +3299,7 @@
 		iks_insert_attrib(affiliate, "affiliation", "owner");
 		ASTOBJ_UNLOCK(iterator);
 	});
-	res = ast_aji_send(client, modify_affiliates);
+	ast_aji_send(client, modify_affiliates);
 	iks_delete(modify_affiliates);
 }
 
@@ -3503,13 +3501,12 @@
  */
 static void aji_request_pubsub_nodes(struct aji_client *client, const char *collection)
 {
-	int res = 0;
 	iks *request = aji_build_node_request(client, collection);
 
 	iks_filter_add_rule(client->f, aji_receive_node_list, client, IKS_RULE_TYPE,
 		IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, client->mid,
 		IKS_RULE_DONE);
-	res = ast_aji_send(client, request);
+	ast_aji_send(client, request);
 	iks_delete(request);
 
 }
@@ -3646,13 +3643,12 @@
 
 static void aji_pubsub_purge_nodes(struct aji_client *client, const char* collection_name)
 {
-	int res = 0;
 	iks *request = aji_build_node_request(client, collection_name);
 	ast_aji_send(client, request);
 	iks_filter_add_rule(client->f, aji_delete_node_list, client, IKS_RULE_TYPE,
 		IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, client->mid,
 		IKS_RULE_DONE);
-	res = ast_aji_send(client, request);
+	ast_aji_send(client, request);
 	iks_delete(request);
 }
 
@@ -3772,15 +3768,14 @@
 static iks* aji_create_pubsub_node(struct aji_client *client, const char *node_type, const
 		char *name, const char *collection_name)
 {
-	int res = 0;
 	iks *node = aji_pubsub_iq_create(client, "set");
-	iks *pubsub, *create, *configure;
+	iks *pubsub, *create;
 	pubsub = iks_insert(node, "pubsub");
 	iks_insert_attrib(pubsub, "xmlns", "http://jabber.org/protocol/pubsub");
 	create = iks_insert(pubsub, "create");
 	iks_insert_attrib(create, "node", name);
-	configure = aji_build_node_config(pubsub, node_type, collection_name);
-	res = ast_aji_send(client, node);
+	aji_build_node_config(pubsub, node_type, collection_name);
+	ast_aji_send(client, node);
 	aji_create_affiliations(client, name);
 	iks_delete(node);
 	return 0;
@@ -3924,7 +3919,6 @@
  */
 static void aji_set_presence(struct aji_client *client, char *to, char *from, int level, char *desc)
 {
-	int res = 0;
 	iks *presence = iks_make_pres(level, desc);
 	iks *cnode = iks_new("c");
 	iks *priority = iks_new("priority");
@@ -3945,7 +3939,7 @@
 		iks_insert_attrib(cnode, "ext", "voice-v1");
 		iks_insert_attrib(cnode, "xmlns", "http://jabber.org/protocol/caps");
 		iks_insert_node(presence, cnode);
-		res = ast_aji_send(client, presence);
+		ast_aji_send(client, presence);
 	} else {
 		ast_log(LOG_ERROR, "Out of memory.\n");
 	}




More information about the asterisk-commits mailing list