[svn-commits] kpfleming: branch group/new_loader_completion r38232 - in /team/group/new_loa...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Jul 26 06:18:13 MST 2006


Author: kpfleming
Date: Wed Jul 26 08:18:12 2006
New Revision: 38232

URL: http://svn.digium.com/view/asterisk?rev=38232&view=rev
Log:
update

Modified:
    team/group/new_loader_completion/   (props changed)
    team/group/new_loader_completion/channel.c
    team/group/new_loader_completion/channels/chan_mgcp.c
    team/group/new_loader_completion/channels/chan_oss.c
    team/group/new_loader_completion/channels/chan_sip.c
    team/group/new_loader_completion/channels/chan_zap.c
    team/group/new_loader_completion/cli.c
    team/group/new_loader_completion/codecs/gsm/Makefile

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
    automerge = please

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jul 26 08:18:12 2006
@@ -1,1 +1,1 @@
-/trunk:1-38126
+/trunk:1-38231

Modified: team/group/new_loader_completion/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channel.c?rev=38232&r1=38231&r2=38232&view=diff
==============================================================================
--- team/group/new_loader_completion/channel.c (original)
+++ team/group/new_loader_completion/channel.c Wed Jul 26 08:18:12 2006
@@ -515,7 +515,7 @@
 	default:
 		pthread_once(&state2str_buf_once, state2str_buf_key_create);
 		if (!(buf = pthread_getspecific(state2str_buf_key))) {
-			if (!(buf = ast_calloc(1, STATE2STR_BUFSIZE)))
+			if (!(buf = ast_malloc(STATE2STR_BUFSIZE)))
 				return NULL;
 			pthread_setspecific(state2str_buf_key, buf);
 		}

Modified: team/group/new_loader_completion/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_mgcp.c?rev=38232&r1=38231&r2=38232&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_mgcp.c (original)
+++ team/group/new_loader_completion/channels/chan_mgcp.c Wed Jul 26 08:18:12 2006
@@ -981,9 +981,7 @@
 		sub->rtp = NULL;
 	}
 
-	/* Decrement use count */
-	ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1);
-	ast_update_use_count();
+	ast_module_unref(ast_module_info->self);
 
 	if ((p->hookstate == MGCP_ONHOOK) && (!sub->next->rtp)) {
 		p->hidecallerid = 0;
@@ -1407,7 +1405,7 @@
 		if (i->amaflags)
 			tmp->amaflags = i->amaflags;
 		sub->owner = tmp;
-		sub->u = ast_module_user_add(tmp);
+		ast_module_ref(ast_module_info->self);
 		tmp->callgroup = i->callgroup;
 		tmp->pickupgroup = i->pickupgroup;
 		ast_string_field_set(tmp, call_forward, i->call_forward);

Modified: team/group/new_loader_completion/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_oss.c?rev=38232&r1=38231&r2=38232&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_oss.c (original)
+++ team/group/new_loader_completion/channels/chan_oss.c Wed Jul 26 08:18:12 2006
@@ -945,7 +945,7 @@
 static int oss_indicate(struct ast_channel *c, int cond, const void *data, size_t datalen)
 {
 	struct chan_oss_pvt *o = c->tech_pvt;
-	int res;
+	int res = -1;
 
 	switch(cond) {
 	case AST_CONTROL_BUSY:
@@ -970,6 +970,7 @@
 		ast_verbose( " << Console Has Been Retrieved from Hold >> \n");
 		ast_moh_stop(c);
 		break;
+
 	default:
 		ast_log(LOG_WARNING,
 		    "Don't know how to display condition %d on %s\n",

Modified: team/group/new_loader_completion/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_sip.c?rev=38232&r1=38231&r2=38232&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_sip.c (original)
+++ team/group/new_loader_completion/channels/chan_sip.c Wed Jul 26 08:18:12 2006
@@ -4446,7 +4446,7 @@
 	int old = 0;
 
 	/* Peer capability is the capability in the SDP, non codec is RFC2833 DTMF (101) */	
-	int peercapability, peernoncodeccapability;
+	int peercapability = 0, peernoncodeccapability = 0;
 	int vpeercapability = 0, vpeernoncodeccapability = 0;
 	struct sockaddr_in sin;		/*!< media socket address */
 	struct sockaddr_in vsin;	/*!< Video socket address */
@@ -4477,11 +4477,11 @@
 	/* Initialize the temporary RTP structures we use to evaluate the offer from the peer */
 	newaudiortp = alloca(ast_rtp_alloc_size());
 	memset(newaudiortp, 0, ast_rtp_alloc_size());
-	ast_rtp_pt_default(newaudiortp);
+	ast_rtp_pt_clear(newaudiortp);
 
 	newvideortp = alloca(ast_rtp_alloc_size());
 	memset(newvideortp, 0, ast_rtp_alloc_size());
-	ast_rtp_pt_default(newvideortp);
+	ast_rtp_pt_clear(newvideortp);
 
 	/* Update our last rtprx when we receive an SDP, too */
 	p->lastrtprx = p->lastrtptx = time(NULL); /* XXX why both ? */
@@ -4519,8 +4519,6 @@
 		int x;
 		int audio = FALSE;
 
-		if (p->vrtp)
-			ast_rtp_pt_clear(newvideortp);  /* Must be cleared in case no m=video line exists */
 		numberofports = 1;
 		if ((sscanf(m, "audio %d/%d RTP/AVP %n", &x, &numberofports, &len) == 2) ||
 		    (sscanf(m, "audio %d RTP/AVP %n", &x, &len) == 1)) {
@@ -4529,7 +4527,6 @@
 			/* Found audio stream in this media definition */
 			portno = x;
 			/* Scan through the RTP payload types specified in a "m=" line: */
-			ast_rtp_pt_clear(newaudiortp);
 			for (codecs = m + len; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) {
 				if (sscanf(codecs, "%d%n", &codec, &len) != 1) {
 					ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs);
@@ -4825,8 +4822,7 @@
 
 	/* Now gather all of the codecs that we are asked for: */
 	ast_rtp_get_current_formats(newaudiortp, &peercapability, &peernoncodeccapability);
-	if (p->vrtp)
-		ast_rtp_get_current_formats(newvideortp, &vpeercapability, &vpeernoncodeccapability);
+	ast_rtp_get_current_formats(newvideortp, &vpeercapability, &vpeernoncodeccapability);
 
 	newjointcapability = p->capability & (peercapability | vpeercapability);
 	newpeercapability = (peercapability | vpeercapability);
@@ -11133,6 +11129,7 @@
 	int outgoing = ast_test_flag(&p->flags[0], SIP_OUTGOING);
 	int res = 0;
 	int reinvite = (p->owner && p->owner->_state == AST_STATE_UP);
+	struct ast_channel *bridgepeer = NULL;
 	
 	if (option_debug > 3) {
 		if (reinvite)
@@ -11233,7 +11230,6 @@
 			build_route(p, req, 1);
 		}
 		
-		struct ast_channel *bridgepeer = NULL;
 		if (p->owner && (p->owner->_state == AST_STATE_UP) && (bridgepeer = ast_bridged_channel(p->owner))) { /* if this is a re-invite */
 			struct sip_pvt *bridgepvt = NULL;
 

Modified: team/group/new_loader_completion/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_zap.c?rev=38232&r1=38231&r2=38232&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_zap.c (original)
+++ team/group/new_loader_completion/channels/chan_zap.c Wed Jul 26 08:18:12 2006
@@ -3117,7 +3117,13 @@
 	oc0 = p0->owner;
 	oc1 = p1->owner;
 
-	ast_mutex_lock(&p0->lock);
+	if (ast_mutex_trylock(&p0->lock)) {
+		/* Don't block, due to potential for deadlock */
+		ast_mutex_unlock(&c0->lock);
+		ast_mutex_unlock(&c1->lock);
+		ast_log(LOG_NOTICE, "Avoiding deadlock...\n");
+		return AST_BRIDGE_RETRY;
+	}
 	if (ast_mutex_trylock(&p1->lock)) {
 		/* Don't block, due to potential for deadlock */
 		ast_mutex_unlock(&p0->lock);

Modified: team/group/new_loader_completion/cli.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/cli.c?rev=38232&r1=38231&r2=38232&view=diff
==============================================================================
--- team/group/new_loader_completion/cli.c (original)
+++ team/group/new_loader_completion/cli.c Wed Jul 26 08:18:12 2006
@@ -49,22 +49,50 @@
 #include "editline/readline/readline.h"
 
 extern unsigned long global_fin, global_fout;
-	
+
+static pthread_key_t ast_cli_buf_key;
+static pthread_once_t ast_cli_buf_once = PTHREAD_ONCE_INIT;
+
+/*! \brief Initial buffer size for resulting strings in ast_cli() */
+#define AST_CLI_MAXSTRLEN   256
+
+static void ast_cli_buf_key_create(void)
+{
+	pthread_key_create(&ast_cli_buf_key, free);
+}
+
 void ast_cli(int fd, char *fmt, ...)
 {
-	char *stuff;
+	struct {
+		size_t len;
+		char str[0];
+	} *buf;
 	int res;
 	va_list ap;
 
+	pthread_once(&ast_cli_buf_once, ast_cli_buf_key_create);
+	if (!(buf = pthread_getspecific(ast_cli_buf_key))) {
+		if (!(buf = ast_malloc(AST_CLI_MAXSTRLEN + sizeof(*buf))))
+			return;
+		buf->len = AST_CLI_MAXSTRLEN;
+		pthread_setspecific(ast_cli_buf_key, buf);
+	}
+
 	va_start(ap, fmt);
-	res = vasprintf(&stuff, fmt, ap);
+	res = vsnprintf(buf->str, buf->len, fmt, ap);
+	while (res >= buf->len) {
+		if (!(buf = ast_realloc(buf, (buf->len * 2) + sizeof(*buf)))) {
+			va_end(ap);
+			return;
+		}
+		buf->len *= 2;
+		pthread_setspecific(ast_cli_buf_key, buf);
+		res = vsnprintf(buf->str, buf->len, fmt, ap);
+	}
 	va_end(ap);
-	if (res == -1) {
-		ast_log(LOG_ERROR, "Memory allocation failure\n");
-	} else {
-		ast_carefulwrite(fd, stuff, strlen(stuff), 100);
-		free(stuff);
-	}
+
+	if (res > 0)
+		ast_carefulwrite(fd, buf->str, strlen(buf->str), 100);
 }
 
 static AST_LIST_HEAD_STATIC(helpers, ast_cli_entry);

Modified: team/group/new_loader_completion/codecs/gsm/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/gsm/Makefile?rev=38232&r1=38231&r2=38232&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/gsm/Makefile (original)
+++ team/group/new_loader_completion/codecs/gsm/Makefile Wed Jul 26 08:18:12 2006
@@ -39,7 +39,7 @@
 
 ifeq (, $(findstring $(OSARCH) , Darwin SunOS ))
 ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm ppc ppc64 ia64 s390))
-ifeq (, $(findstring $(shell uname -m) , ppc ppc64 alpha armv4l ))
+ifeq (, $(findstring $(shell uname -m) , ppc ppc64 alpha armv4l s390 ))
 OPTIMIZE+=-march=$(PROC)
 endif
 endif
@@ -209,7 +209,7 @@
 # XXX Keep a space after each findstring argument
 # XXX should merge with GSM_OBJECTS
 ifeq (${OSARCH},Linux)
-ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc ))
+ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc s390 ))
 ifeq (,$(findstring ${PROC} , arm ia64 s390 ))
 GSM_SOURCES+= $(SRC)/k6opt.s
 endif



More information about the svn-commits mailing list