Skip to content

Commit

Permalink
Do not set full flag if remaining size if 0
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepmistry committed Aug 24, 2016
1 parent e17e08b commit 41f60df
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/socket/source/socket_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ void socketBufferCb(SOCKET sock, uint8 u8Msg, void *pvMsg)

/* Buffer full, stop reception. */
if (SOCKET_BUFFER_TCP_SIZE - *(gastrSocketBuffer[sock].head) < SOCKET_BUFFER_MTU) {
*(gastrSocketBuffer[sock].flag) |= SOCKET_BUFFER_FLAG_FULL;
if (pstrRecv->u16RemainingSize != 0) {
*(gastrSocketBuffer[sock].flag) |= SOCKET_BUFFER_FLAG_FULL;
}
}
else {
recv(sock, gastrSocketBuffer[sock].buffer + *(gastrSocketBuffer[sock].head),
Expand Down Expand Up @@ -168,7 +170,9 @@ void socketBufferCb(SOCKET sock, uint8 u8Msg, void *pvMsg)

/* Buffer full, stop reception. */
if (SOCKET_BUFFER_UDP_SIZE - *(gastrSocketBuffer[sock].head) < SOCKET_BUFFER_MTU + SOCKET_BUFFER_UDP_HEADER_SIZE) {
*(gastrSocketBuffer[sock].flag) |= SOCKET_BUFFER_FLAG_FULL;
if (pstrRecv->u16RemainingSize != 0) {
*(gastrSocketBuffer[sock].flag) |= SOCKET_BUFFER_FLAG_FULL;
}
}
else {
if (hif_small_xfer && hif_small_xfer != 3) {
Expand Down

0 comments on commit 41f60df

Please sign in to comment.