Merged revisions 104015 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104015 | kpfleming | 2008-02-21 08:33:51 -0600 (Thu, 21 Feb 2008) | 2 lines

reduce the likelihood that HTTP Manager session ids will consist of primarily '1' bits

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2008-02-21 14:44:04 +00:00
parent a8e821d061
commit 1a6711a42d

View File

@@ -3427,7 +3427,7 @@ static struct ast_str *generic_http_callback(enum output_format format,
ast_mutex_init(&s->__lock);
ast_mutex_lock(&s->__lock);
s->inuse = 1;
s->managerid = rand() | 1; /* make sure it is non-zero */
s->managerid = (rand() ^ (unsigned long) s) | 1; /* make sure it is non-zero */
s->last_ev = grab_last();
AST_LIST_LOCK(&sessions);
AST_LIST_INSERT_HEAD(&sessions, s, list);