[asterisk-commits] kpfleming: branch 1.4 r104015 - /branches/1.4/main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 21 08:33:52 CST 2008


Author: kpfleming
Date: Thu Feb 21 08:33:51 2008
New Revision: 104015

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104015
Log:
reduce the likelihood that HTTP Manager session ids will consist of primarily '1' bits

Modified:
    branches/1.4/main/manager.c

Modified: branches/1.4/main/manager.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/manager.c?view=diff&rev=104015&r1=104014&r2=104015
==============================================================================
--- branches/1.4/main/manager.c (original)
+++ branches/1.4/main/manager.c Thu Feb 21 08:33:51 2008
@@ -2660,7 +2660,7 @@
 		ast_mutex_init(&s->__lock);
 		ast_mutex_lock(&s->__lock);
 		s->inuse = 1;
-		s->managerid = rand() | (unsigned long)s;
+		s->managerid = rand() ^ (unsigned long) s;
 		AST_LIST_LOCK(&sessions);
 		AST_LIST_INSERT_HEAD(&sessions, s, list);
 		/* Hook into the last spot in the event queue */




More information about the asterisk-commits mailing list