[asterisk-commits] res xmpp: fix inverted return code check in OAuth (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 22 07:43:36 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6249 )

Change subject: res_xmpp: fix inverted return code check in OAuth
......................................................................

res_xmpp: fix inverted return code check in OAuth

fetch_access_token calls func_curl via ast_func_read. The latter returns 0 upon
success and -1 if the function is not available.
This commit inverts the return code check so that an error is printed if the
module is not loaded and not if it is loaded.

ASTERISK-27207 #close

Change-Id: I9ef903f80702d1218e8701f65a4e5e918e6548fb
---
M res/res_xmpp.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Sean Bright: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_xmpp.c b/res/res_xmpp.c
index bff59b8..d8487f5 100644
--- a/res/res_xmpp.c
+++ b/res/res_xmpp.c
@@ -3917,7 +3917,7 @@
 	ast_debug(2, "Performing OAuth 2.0 authentication for client '%s' using command: %s\n",
 		cfg->name, cmd);
 
-	if (!ast_func_read(NULL, cmd, cBuf, sizeof(cBuf) - 1)) {
+	if (ast_func_read(NULL, cmd, cBuf, sizeof(cBuf) - 1)) {
 		ast_log(LOG_ERROR, "CURL is unavailable. This is required for OAuth 2.0 authentication of XMPP client '%s'. Please ensure it is loaded.\n",
 			cfg->name);
 		return -1;

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I9ef903f80702d1218e8701f65a4e5e918e6548fb
Gerrit-Change-Number: 6249
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Kuron <m.kuron at gmx.de>
Gerrit-Reviewer: Andrey <andr06 at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Michael Kuron <m.kuron at gmx.de>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170822/5615314b/attachment-0001.html>


More information about the asterisk-commits mailing list