[Asterisk-code-review] ARI: Channels added to Stasis application during WebSocket c... (asterisk[master])
Joshua Colp
asteriskteam at digium.com
Thu Jul 30 08:54:59 CDT 2015
Joshua Colp has posted comments on this change.
Change subject: ARI: Channels added to Stasis application during WebSocket creation ...
......................................................................
Patch Set 3: Code-Review-1
(7 comments)
https://gerrit.asterisk.org/#/c/993/3/res/ari/resource_events.c
File res/ari/resource_events.c:
Line 38: #define APPS_NUM_BUCKETS 11
Why the change from 7 to 11?
Line 49: struct ao2_container *message_queue; /*!< Container for holding delayed
Doing this as an ao2 container with buckets doesn't make this a queue, it turns it into a hash table. Stuff will be out of order. I'd suggest using a vector instead.
Line 96: if (!session) {
How can we not have a handle to the session?
Line 108: } else if (!session->ws_session) {
Is there a race condition here between ws_session being on the session and our check? Shouldn't it be locked during this check?
Line 511: session = ao2_find(event_session_registry, session_id, OBJ_SEARCH_KEY);
The session doesn't need to remain in the registry past here, it can be unlinked immediately. This simplifies things slightly.
https://gerrit.asterisk.org/#/c/993/3/res/res_http_websocket.c
File res/res_http_websocket.c:
Line 90: char session_id[]; /*!< The identifier for the websocket session */
UUIDs have a fixed size, you've used it in the variable below and might as well use it here.
Line 689: char session_id[AST_UUID_STR_LEN];
If you make the session_id a fixed size in the session you don't need this, you can put the uuid directly in it.
--
To view, visit https://gerrit.asterisk.org/993
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iafef7b85a2e0bf78c114db4c87ffc3d16d671a17
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-HasComments: Yes
More information about the asterisk-code-review
mailing list