[Asterisk-code-review] Add data buffer API to store packets. (asterisk[15])

Benjamin Keith Ford asteriskteam at digium.com
Fri Mar 23 11:41:28 CDT 2018


Benjamin Keith Ford has posted comments on this change. ( https://gerrit.asterisk.org/8604 )

Change subject: Add data buffer API to store packets.
......................................................................


Patch Set 7:

(2 comments)

https://gerrit.asterisk.org/#/c/8604/7/main/data_buffer.c
File main/data_buffer.c:

https://gerrit.asterisk.org/#/c/8604/7/main/data_buffer.c@112
PS7, Line 112: 			buffer_payload = data_buffer_payload_alloc(NULL, -1);
             : 			if (buffer_payload) {
             : 				AST_LIST_INSERT_TAIL(&buffer->cached_payloads, buffer_payload, list);
             : 				buffer->cache_count++;
             : 			}
             : 
             : 			i++;
> If the entry does not get inserted into the cache then "i" still gets incre
I was worried that, if something went wrong, it would get stuck in an infinite loop (cache_count never being incremented for some reason), but I guess at that point something has gone wrong anyways!


https://gerrit.asterisk.org/#/c/8604/7/main/data_buffer.c@178
PS7, Line 178: 			if (remove) {
> I would only remove items from the cache if the current cache size is great
This one is for the buffer, not the cache :)



-- 
To view, visit https://gerrit.asterisk.org/8604
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: comment
Gerrit-Change-Id: Iff13c5d4795d52356959fe2a57360cd57dfade07
Gerrit-Change-Number: 8604
Gerrit-PatchSet: 7
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
Gerrit-Comment-Date: Fri, 23 Mar 2018 16:41:28 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180323/55c2f9f7/attachment.html>


More information about the asterisk-code-review mailing list