[asterisk-commits] wedhorn: trunk r379583 - in /trunk: ./ channels/chan_skinny.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 19 21:06:32 CST 2013


Author: wedhorn
Date: Sat Jan 19 21:06:28 2013
New Revision: 379583

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379583
Log:
Rewrite skinny dialing to remove threaded simpleswitch

This rewrite changes skinny dialing from the threaded simpleswitch
to a scheduled timeout approach. There were some underlying issues
with the threaded simple switch with occasional corruption and
possible segfaults.

Review: https://reviewboard.asterisk.org/r/2240/
........

Merged revisions 378622 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/channels/chan_skinny.c

Propchange: trunk/
            ('branch-11-blocked' removed)

Propchange: trunk/
            ('branch-11-merged' removed)

Modified: trunk/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=379583&r1=379582&r2=379583
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Sat Jan 19 21:06:28 2013
@@ -6865,15 +6865,21 @@
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&sessions, cur, list) {
 		if (cur == s) {
 			AST_LIST_REMOVE_CURRENT(list);
-			if (s->fd > -1)
+			if (s->fd > -1) {
 				close(s->fd);
-
-			if (!s->device)
-				ast_atomic_fetchadd_int(&unauth_sessions, -1);
+			}
+
+			if (s->device) {
+				s->device->session = NULL;
+			} else {
+ 				ast_atomic_fetchadd_int(&unauth_sessions, -1);
+			}
 
 			ast_mutex_destroy(&s->lock);
 
 			ast_free(s);
+
+			break;
 		}
 	}
 	AST_LIST_TRAVERSE_SAFE_END
@@ -7011,21 +7017,22 @@
 		res = get_input(s);
 		if (res < 0) {
 			ast_verb(3, "Ending Skinny session from %s (bad input)\n", ast_inet_ntoa(s->sin.sin_addr));
-			break;
+			destroy_session(s);
+			return NULL;
 		}
 
 		if (res > 0)
 		{
 			if (!(req = skinny_req_parse(s))) {
+				ast_verb(3, "Ending Skinny session from %s (failed parse)\n", ast_inet_ntoa(s->sin.sin_addr));
 				destroy_session(s);
-				ast_verb(3, "Ending Skinny session from %s (failed parse)\n", ast_inet_ntoa(s->sin.sin_addr));
 				return NULL;
 			}
 
 			res = handle_message(req, s);
 			if (res < 0) {
+				ast_verb(3, "Ending Skinny session from %s\n", ast_inet_ntoa(s->sin.sin_addr));
 				destroy_session(s);
-				ast_verb(3, "Ending Skinny session from %s\n", ast_inet_ntoa(s->sin.sin_addr));
 				return NULL;
 			}
 		}




More information about the asterisk-commits mailing list