[Asterisk-code-review] ARI: Added new functionality to load a single module. (asterisk[13])

Mark Michelson asteriskteam at digium.com
Tue Jul 7 15:07:18 CDT 2015


Mark Michelson has posted comments on this change.

Change subject: ARI: Added new functionality to load a single module.
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/807/1/res/ari/resource_asterisk.c
File res/ari/resource_asterisk.c:

Line 167: 	
Red blob spotted.


Line 168: 	if (load_result == 1) {
        : 		ast_ari_response_error(
        : 			response, 404, "Not Found",
        : 			"Module does not exist");
        : 		return;
        : 	} else if (load_result == 2 || load_result == -1) {
        : 		ast_ari_response_error(
        : 			response, 409, "Conflict",
        : 			"Module could not be loaded");
        : 		return;
        : 	}
I would alter these if checks. First, instead of using comparisons to integers, use the values in enum ast_module_load_result in include/asterisk/module.h

Second, I'm not sure if the values being compared here are correct. Since you've already performed an ast_module_check() earlier, I think that any value returned other than AST_MODULE_LOAD_SUCCESS should result in the 404 response code. Did you run into situations where it made sense to return 409 on certain return values?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9e05d5b8c5c666ecfef341504f9edc1aa84fda33
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list