From 83f6b1118c3f184f7a1f47bd8e50fdd5278352ab Mon Sep 17 00:00:00 2001 From: Michael Kuron Date: Sun, 20 Aug 2017 15:15:37 +0200 Subject: 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 --- res/res_xmpp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'res') diff --git a/res/res_xmpp.c b/res/res_xmpp.c index 09af0b918..f5bac130a 100644 --- a/res/res_xmpp.c +++ b/res/res_xmpp.c @@ -3917,7 +3917,7 @@ static int fetch_access_token(struct ast_xmpp_client_config *cfg) 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; -- cgit v1.2.3