[svn-commits] rmudgett: branch 1.6.2 r305889 - in /branches/1.6.2: ./ apps/ channels/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Feb 2 18:15:13 CST 2011


Author: rmudgett
Date: Wed Feb  2 18:15:07 2011
New Revision: 305889

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=305889
Log:
Merged revisions 305888 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r305888 | rmudgett | 2011-02-02 18:02:43 -0600 (Wed, 02 Feb 2011) | 8 lines

  Minor AST_FRAME_TEXT related issues.

  * Include the null terminator in the buffer length.  When the frame is
  queued it is copied.  If the null terminator is not part of the frame
  buffer length, the receiver could see garbage appended onto it.

  * Add channel lock protection with ast_sendtext().

  * Fixed AMI SendText action ast_sendtext() return value check.
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/apps/app_sendtext.c
    branches/1.6.2/channels/chan_sip.c
    branches/1.6.2/main/channel.c
    branches/1.6.2/main/manager.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: branches/1.6.2/apps/app_sendtext.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/apps/app_sendtext.c?view=diff&rev=305889&r1=305888&r2=305889
==============================================================================
--- branches/1.6.2/apps/app_sendtext.c (original)
+++ branches/1.6.2/apps/app_sendtext.c Wed Feb  2 18:15:07 2011
@@ -99,10 +99,10 @@
 		return 0;
 	}
 	status = "FAILURE";
-	ast_channel_unlock(chan);
 	res = ast_sendtext(chan, args.text);
 	if (!res)
 		status = "SUCCESS";
+	ast_channel_unlock(chan);
 	pbx_builtin_setvar_helper(chan, "SENDTEXTSTATUS", status);
 	return 0;
 }

Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=305889&r1=305888&r2=305889
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Wed Feb  2 18:15:07 2011
@@ -14710,7 +14710,7 @@
 		f.subclass = 0;
 		f.offset = 0;
 		f.data.ptr = buf;
-		f.datalen = strlen(buf);
+		f.datalen = strlen(buf) + 1;
 		ast_queue_frame(p->owner, &f);
 		transmit_response(p, "202 Accepted", req); /* We respond 202 accepted, since we relay the message */
 		return;

Modified: branches/1.6.2/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/channel.c?view=diff&rev=305889&r1=305888&r2=305889
==============================================================================
--- branches/1.6.2/main/channel.c (original)
+++ branches/1.6.2/main/channel.c Wed Feb  2 18:15:07 2011
@@ -3470,13 +3470,18 @@
 int ast_sendtext(struct ast_channel *chan, const char *text)
 {
 	int res = 0;
+
+	ast_channel_lock(chan);
 	/* Stop if we're a zombie or need a soft hangup */
-	if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan))
+	if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan)) {
+		ast_channel_unlock(chan);
 		return -1;
+	}
 	CHECK_BLOCKING(chan);
 	if (chan->tech->send_text)
 		res = chan->tech->send_text(chan, text);
 	ast_clear_flag(chan, AST_FLAG_BLOCKING);
+	ast_channel_unlock(chan);
 	return res;
 }
 

Modified: branches/1.6.2/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/manager.c?view=diff&rev=305889&r1=305888&r2=305889
==============================================================================
--- branches/1.6.2/main/manager.c (original)
+++ branches/1.6.2/main/manager.c Wed Feb  2 18:15:07 2011
@@ -2106,12 +2106,13 @@
 
 	res = ast_sendtext(c, textmsg);
 	ast_channel_unlock(c);
-	
-	if (res > 0)
+
+	if (res >= 0) {
 		astman_send_ack(s, m, "Success");
-	else
+	} else {
 		astman_send_error(s, m, "Failure");
-	
+	}
+
 	return res;
 }
 




More information about the svn-commits mailing list