[Asterisk-code-review] res sorcery memory cache: Add basic module implementation. (asterisk[master])
Mark Michelson
asteriskteam at digium.com
Tue May 19 11:25:25 CDT 2015
Mark Michelson has posted comments on this change.
Change subject: res_sorcery_memory_cache: Add basic module implementation.
......................................................................
Patch Set 1: Code-Review-1
(2 comments)
What is the threadpool for? Is it going to come into play once expiration is implemented?
https://gerrit.asterisk.org/#/c/480/1/res/res_sorcery_memory_cache.c
File res/res_sorcery_memory_cache.c:
Line 443: if (ast_strlen_zero(value)) {
: ast_log(LOG_ERROR, "A name must be specified for the memory cache\n");
: return NULL;
: }
The return NULL line is mis-indented.
Line 449: } else if (!strcasecmp(name, "maximum_objects")) {
: if (ast_strlen_zero(value)) {
: ast_log(LOG_ERROR, "A value for maximum objects must be provided for memory cache\n");
: return NULL;
: } else if (!strncmp(value, "-", 1)) {
: ast_log(LOG_ERROR, "An invalid negative value '%s' has been provided for maximum objects for memory cache\n",
: value);
: return NULL;
: } else if (sscanf(value, "%30u", &cache->maximum_objects) != 1) {
: ast_log(LOG_ERROR, "Unsupported maximum objects value of '%s' used for memory cache\n",
: value);
: return NULL;
: }
The code here is repeated for each of the numeric options. This could be factored into a separate function.
--
To view, visit https://gerrit.asterisk.org/480
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id8a6a357ef5a83d466f81eee56a67d13eeb118b9
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: Yes
More information about the asterisk-code-review
mailing list