mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 23:38:23 +00:00
Do not lock the 'sessions' container, lock the allocated 'session'.
There was a typo in the structure being locked, and we were locking the 'sessions' container instead of the 'session' structure thar we are modifying. Reported by seanbright on #asterisk-dev, thanks! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3376,7 +3376,6 @@ static void *session_do(void *data)
|
|||||||
if (session == NULL) {
|
if (session == NULL) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
ao2_lock(sessions);
|
|
||||||
|
|
||||||
flags = fcntl(ser->fd, F_GETFL);
|
flags = fcntl(ser->fd, F_GETFL);
|
||||||
if (!block_sockets) { /* make sure socket is non-blocking */
|
if (!block_sockets) { /* make sure socket is non-blocking */
|
||||||
@@ -3386,6 +3385,7 @@ static void *session_do(void *data)
|
|||||||
}
|
}
|
||||||
fcntl(ser->fd, F_SETFL, flags);
|
fcntl(ser->fd, F_SETFL, flags);
|
||||||
|
|
||||||
|
ao2_lock(session);
|
||||||
/* Hook to the tail of the event queue */
|
/* Hook to the tail of the event queue */
|
||||||
session->last_ev = grab_last();
|
session->last_ev = grab_last();
|
||||||
|
|
||||||
@@ -3399,7 +3399,7 @@ static void *session_do(void *data)
|
|||||||
|
|
||||||
AST_LIST_HEAD_INIT_NOLOCK(&session->datastores);
|
AST_LIST_HEAD_INIT_NOLOCK(&session->datastores);
|
||||||
|
|
||||||
ao2_unlock(sessions);
|
ao2_unlock(session);
|
||||||
astman_append(&s, "Asterisk Call Manager/%s\r\n", AMI_VERSION); /* welcome prompt */
|
astman_append(&s, "Asterisk Call Manager/%s\r\n", AMI_VERSION); /* welcome prompt */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if ((res = do_message(&s)) < 0) {
|
if ((res = do_message(&s)) < 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user