Skip to content

Commit

Permalink
[DEV] Do not update nbBytesXxx variables when sendmsg/recvmsg failed
Browse files Browse the repository at this point in the history
  • Loading branch information
BoubacarDiene committed Feb 9, 2020
1 parent 2a175e5 commit 563ad9e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/network/LinkHelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,9 @@ static int8_t readData_f(struct link_helper_s *obj, struct link_s *src, struct l
}
pData->nbBytesReceived = 0;
}

pData->nbBytesReceived = (size_t)nbBytesReceived;
else {
pData->nbBytesReceived = (size_t)nbBytesReceived;
}

if (pData->nbBytesReceived < buffer->length) {
ssize_t nbBytes = 0;
Expand Down Expand Up @@ -834,8 +835,9 @@ static int8_t writeData_f(struct link_helper_s *obj, struct link_s *src, struct
}
pData->nbBytesSent = 0;
}

pData->nbBytesSent = (size_t)nbBytesSent;
else {
pData->nbBytesSent = (size_t)nbBytesSent;
}

if (pData->nbBytesSent < buffer->length) {
uint8_t sendByBlock = (errno == EMSGSIZE);
Expand Down

0 comments on commit 563ad9e

Please sign in to comment.