[svn-commits] dvossel: branch 1.6.2 r309083 - /branches/1.6.2/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 1 10:05:34 CST 2011


Author: dvossel
Date: Tue Mar  1 10:05:25 2011
New Revision: 309083

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=309083
Log:
Fixes thread blocking issue in the sip TCP/TLS implementation.

(closes issue #18497)
Reported by: vois
Patches:
      issues_18497.diff uploaded by dvossel (license 671)
Tested by: vois, rossbeer, kowalma, Freddi_Fonet


Modified:
    branches/1.6.2/channels/chan_sip.c

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=309083&r1=309082&r2=309083
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Tue Mar  1 10:05:25 2011
@@ -3061,14 +3061,15 @@
 				ao2_lock(me);
 				if (!(packet = AST_LIST_REMOVE_HEAD(&me->packet_q, entry))) {
 					ast_log(LOG_WARNING, "TCPTLS thread alert_pipe indicated packet should be sent, but frame_q is empty");
-				} else if (ast_tcptls_server_write(tcptls_session, ast_str_buffer(packet->data), packet->len) == -1) {
-					ast_log(LOG_WARNING, "Failure to write to tcp/tls socket\n");
 				}
+				ao2_unlock(me);
 
 				if (packet) {
+					if (ast_tcptls_server_write(tcptls_session, ast_str_buffer(packet->data), packet->len) == -1) {
+						ast_log(LOG_WARNING, "Failure to write to tcp/tls socket\n");
+					}
 					ao2_t_ref(packet, -1, "tcptls packet sent, this is no longer needed");
 				}
-				ao2_unlock(me);
 				break;
 			default:
 				ast_log(LOG_ERROR, "Unknown tcptls thread alert '%d'\n", alert);




More information about the svn-commits mailing list