1 Star 0 Fork 32

misaka00251/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0026-get-fin-notice-app.patch 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2022-03-16 22:23 . fix gazelle test issue
From a066142dfb38235ea46307e4b1d3395dcc2694a7 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Tue, 15 Mar 2022 17:47:42 +0800
Subject: [PATCH 26/34] get fin notice app
---
src/lstack/api/lstack_epoll.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index cf072b0..1f0aea8 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -73,6 +73,11 @@ void add_epoll_event(struct netconn *conn, uint32_t event)
/* conn sock nerver null, because lwip call this func */
struct lwip_sock *sock = get_socket(conn->socket);
+ /* close_wait event should be (EPOLLRDHUP | EPOLLIN), but lwip is EPOLLERR */
+ if (event == EPOLLERR && conn->pcb.tcp && conn->pcb.tcp->state == CLOSE_WAIT) {
+ event = EPOLLRDHUP | EPOLLIN | EPOLLERR;
+ }
+
/* shadow_fd event notice listen_fd */
if (sock->shadowed_sock) {
sock = sock->shadowed_sock;
@@ -286,7 +291,6 @@ static int32_t get_lwip_events(struct weakup_poll *weakup, void *out, uint32_t m
struct epoll_event *events = (struct epoll_event *)out;
struct pollfd *fds = (struct pollfd *)out;
-
if (etype == TYPE_EPOLL) {
maxevents = LWIP_MIN(EPOLL_MAX_EVENTS, maxevents);
}
@@ -300,7 +304,7 @@ static int32_t get_lwip_events(struct weakup_poll *weakup, void *out, uint32_t m
}
/* close sock */
if (sock->stack == NULL) {
- return true;
+ continue;
}
__atomic_store_n(&sock->have_event, false, __ATOMIC_RELEASE);
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/misaka00251/gazelle.git
git@gitee.com:misaka00251/gazelle.git
misaka00251
gazelle
gazelle
master

搜索帮助