Skip to content

Commit 41f60df

Browse files
committed
Do not set full flag if remaining size if 0
1 parent e17e08b commit 41f60df

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/socket/source/socket_buffer.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ void socketBufferCb(SOCKET sock, uint8 u8Msg, void *pvMsg)
110110

111111
/* Buffer full, stop reception. */
112112
if (SOCKET_BUFFER_TCP_SIZE - *(gastrSocketBuffer[sock].head) < SOCKET_BUFFER_MTU) {
113-
*(gastrSocketBuffer[sock].flag) |= SOCKET_BUFFER_FLAG_FULL;
113+
if (pstrRecv->u16RemainingSize != 0) {
114+
*(gastrSocketBuffer[sock].flag) |= SOCKET_BUFFER_FLAG_FULL;
115+
}
114116
}
115117
else {
116118
recv(sock, gastrSocketBuffer[sock].buffer + *(gastrSocketBuffer[sock].head),
@@ -168,7 +170,9 @@ void socketBufferCb(SOCKET sock, uint8 u8Msg, void *pvMsg)
168170

169171
/* Buffer full, stop reception. */
170172
if (SOCKET_BUFFER_UDP_SIZE - *(gastrSocketBuffer[sock].head) < SOCKET_BUFFER_MTU + SOCKET_BUFFER_UDP_HEADER_SIZE) {
171-
*(gastrSocketBuffer[sock].flag) |= SOCKET_BUFFER_FLAG_FULL;
173+
if (pstrRecv->u16RemainingSize != 0) {
174+
*(gastrSocketBuffer[sock].flag) |= SOCKET_BUFFER_FLAG_FULL;
175+
}
172176
}
173177
else {
174178
if (hif_small_xfer && hif_small_xfer != 3) {

0 commit comments

Comments
 (0)