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

Benjamin Keith Ford asteriskteam at digium.com
Wed Mar 21 11:56:40 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 4:

(2 comments)

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

https://gerrit.asterisk.org/#/c/8604/4/main/data_buffer.c@208
PS4, Line 208: 	if (buffer->count == buffer->max) {
> Do we really want to silently discard data on cases where we overflow the d
You could do that with logic outside the buffer if you want to - check the max and take action afterwards. As far as dropping data, you would have to do that once it reached the max one way or another. It could be done by the user, or could be done here automatically. I personally think the latter is a good option since it removes some hassle. Log messages could be done by the caller; that would provide more detailed messages too, specific to what part of Asterisk is using the buffer.


https://gerrit.asterisk.org/#/c/8604/4/main/data_buffer.c@260
PS4, Line 260: 	if (pos == -1) {
> size_t should be unsigned, and should never be allowed to be -1.  I'm surpr
Good catch. I was considering changing it to a 0 check, but I'm not sure if there would be a situation where pos could be 0. Maybe passing in NULL here could return the head?



-- 
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: 4
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: Wed, 21 Mar 2018 16:56:40 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180321/d60618a5/attachment-0001.html>


More information about the asterisk-code-review mailing list