Commit e65c43b7 authored by Soemin Tjong's avatar Soemin Tjong Committed by Dan Mihai

IoT-1516: Return error when WSARecvMsg() fails.

https://jira.iotivity.org/browse/IOT-1516?

Change-Id: I5c16b47c9a462ac0b8d9f47cfaea89a5f84baeeb
Signed-off-by: default avatarSoemin Tjong <stjong@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19021Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarDan Mihai <Daniel.Mihai@microsoft.com>
parent 6a2f9bfc
......@@ -619,12 +619,14 @@ static CAResult_t CAReceiveMessage(CASocketFd_t fd, CATransportFlags_t flags)
uint32_t recvLen = 0;
uint32_t ret = caglobals.ip.wsaRecvMsg(fd, &msg, (LPDWORD)&recvLen, 0,0);
OIC_LOG_V(DEBUG, TAG, "WSARecvMsg recvd %u bytes", recvLen);
if (OC_SOCKET_ERROR == ret)
{
OIC_LOG_V(ERROR, TAG, "WSARecvMsg failed %i", WSAGetLastError());
return CA_STATUS_FAILED;
}
OIC_LOG_V(DEBUG, TAG, "WSARecvMsg recvd %u bytes", recvLen);
for (WSACMSGHDR *cmp = WSA_CMSG_FIRSTHDR(&msg); cmp != NULL;
cmp = WSA_CMSG_NXTHDR(&msg, cmp))
{
......@@ -678,7 +680,7 @@ static CAResult_t CAReceiveMessage(CASocketFd_t fd, CATransportFlags_t flags)
{
#ifdef __WITH_DTLS__
#ifdef TB_LOG
int decryptResult =
int decryptResult =
#endif
CAdecryptSsl(&sep, (uint8_t *)recvBuffer, recvLen);
OIC_LOG_V(DEBUG, TAG, "CAdecryptSsl returns [%d]", decryptResult);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment