Skip to content

Commit

Permalink
Merge pull request #91 from sandeepmistry/socket-buffer-full-remainin…
Browse files Browse the repository at this point in the history
…g-only

Do not set full flag if remaining size if 0
  • Loading branch information
agdl authored Sep 8, 2016
2 parents a23a54f + 9ad6817 commit d27bf7c
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 d27bf7c

Please sign in to comment.