1 Star 0 Fork 32

shafeipaozi/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0122-optimize-recv-exit-process-for-FIN-and-unsupport-SO_.patch 1.55 KB
一键复制 编辑 原始数据 按行查看 历史
yinbin6 提交于 2024-02-04 15:21 . sync patches from upstream
From 7499d04834da6c3774923972d927229b10189e62 Mon Sep 17 00:00:00 2001
From: yangchen <yangchen145@huawei.com>
Date: Mon, 22 Jan 2024 12:52:09 +0800
Subject: [PATCH] optimize recv exit process for FIN and unsupport SO_RCVBUF
---
src/lstack/api/lstack_wrap.c | 1 +
src/lstack/core/lstack_lwip.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c
index 3db62c7..372e102 100644
--- a/src/lstack/api/lstack_wrap.c
+++ b/src/lstack/api/lstack_wrap.c
@@ -372,6 +372,7 @@ static bool unsupport_optname(int32_t optname)
optname == SO_SNDTIMEO ||
optname == SO_RCVTIMEO ||
optname == SO_SNDBUF ||
+ optname == SO_RCVBUF ||
optname == TCP_INFO ||
optname == TCP_MAXSEG ||
optname == TCP_CONGESTION) {
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index 6ebe589..ce218f5 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -1016,7 +1016,7 @@ ssize_t do_lwip_read_from_stack(int32_t fd, void *buf, size_t len, int32_t flags
} else {
while (gazelle_ring_read(sock->recv_ring, (void **)&pbuf, 1) != 1 && recvd == 0) {
/* if the connection is disconnected, recv return 0 */
- if ((sock->errevent > 0 || (sock->conn->pcb.tcp->flags & TF_FIN)) && !NETCONN_IS_DATAIN(sock)) {
+ if (sock->errevent > 0 && !NETCONN_IS_DATAIN(sock)) {
return 0;
}
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shafeipaozi/gazelle.git
git@gitee.com:shafeipaozi/gazelle.git
shafeipaozi
gazelle
gazelle
master

搜索帮助