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

Matthew Fredrickson asteriskteam at digium.com
Wed Mar 21 11:19:44 CDT 2018


Matthew Fredrickson has posted comments on this change. ( https://gerrit.asterisk.org/8604 )

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


Patch Set 4: Code-Review-1

(5 comments)

A couple of findings and questions.  Still looking through it, hopefully will have time to finish after lunch.

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@138
PS4, Line 138: 				ast_free(existing_payload);
> Whenever the data buffer entry is freed, it's contained payload may need re
+1


https://gerrit.asterisk.org/#/c/8604/4/main/data_buffer.c@141
PS4, Line 141: 			node++;
> No reason to continue incrementing node if node > size. Can wrap in an "els
Seems like this is no *super* important though, no?


https://gerrit.asterisk.org/#/c/8604/4/main/data_buffer.c@150
PS4, Line 150: void ast_data_buffer_cache_adjust(struct ast_data_buffer *buffer)
Does this function need to be publicly exposed (shouldn't it be ok if it's static)?


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 data_buffer?  Maybe we should be letting the caller deal with this situation (by doing buffer dropping, etc, itself) - or at the very least maybe we should be emitting some kind of conditional log message.


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 surprised that the compiler let this pass through.



-- 
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:19:44 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180321/e40ec564/attachment.html>


More information about the asterisk-code-review mailing list