Skip to content

Commit

Permalink
There are 2 potential blocking calls when using IoTCredentialProvider… (
Browse files Browse the repository at this point in the history
#223)

* There are 2 potential blocking calls when using IoTCredentialProvider: Curl & Lws.
The curl call already has logging when the curl_easy_perform fails, however the LWS blocking call did not have any logging on failure.

* Corrected the capitalization, added general error message, but also wanted to keep the specific error message for LWS failure
  • Loading branch information
jdelapla authored Jul 15, 2021
1 parent a8091d1 commit f5700bc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/source/Common/Lws/LwsCall.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ STATUS blockingLwsCall(PRequestInfo pRequestInfo, PCallInfo pCallInfo)

CleanUp:

if(retStatus == STATUS_IOT_CREATE_LWS_CONTEXT_FAILED)
{
DLOGW("Unable to create LWS context or connect to Websocket server");
}
else
{
CHK_LOG_ERR(retStatus);
}
if (lwsContext != NULL) {
// Trigger termination
ATOMIC_STORE_BOOL(&pCallInfo->pRequestInfo->terminating, TRUE);
Expand Down Expand Up @@ -259,4 +267,4 @@ INT32 lwsIotCallbackRoutine(struct lws* wsi, enum lws_callback_reasons reason, P
} else {
return retValue;
}
}
}

0 comments on commit f5700bc

Please sign in to comment.