summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHanhui <sylixos@gmail.com>2019-07-25 01:48:13 (GMT)
committer Hanhui <sylixos@gmail.com>2019-07-15 14:37:12 (GMT)
commitfeb2f552df2085a6d8b34a63a0f1ca139966ab40 (patch)
tree8870ea1179e8aec8f3d456f3765b6544657984bc
parentdc8400bea0a72a1cad39ac84c015389057ffee60 (diff)
downloadAIC-OS-feb2f552df2085a6d8b34a63a0f1ca139966ab40.zip
Fixed unsend check in listen state socket.
-rw-r--r--SylixOS/net/lwip/src/api/api_msg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/SylixOS/net/lwip/src/api/api_msg.c b/SylixOS/net/lwip/src/api/api_msg.c
index bf94be4..233cc05 100644
--- a/SylixOS/net/lwip/src/api/api_msg.c
+++ b/SylixOS/net/lwip/src/api/api_msg.c
@@ -1019,7 +1019,9 @@ lwip_netconn_do_close_internal(struct netconn *conn WRITE_DELAYED_PARAM)
/* check linger possibilites before calling tcp_close */
err = ERR_OK;
/* linger enabled/required at all? (i.e. is there untransmitted data left?) */
- if ((conn->linger >= 0) && (conn->pcb.tcp->unsent || conn->pcb.tcp->unacked)) {
+ /* SylixOS Fixed listen conn do not need check linger */
+ if ((conn->state != NETCONN_LISTEN) &&
+ (conn->linger >= 0) && (conn->pcb.tcp->unsent || conn->pcb.tcp->unacked)) {
if ((conn->linger == 0)) {
/* data left but linger prevents waiting */
tcp_abort(tpcb);