代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 8870ece28ab3b467c43c1231177d826fd7907801 Mon Sep 17 00:00:00 2001
From: wu-changsheng <wuchangsheng2@huawei.com>
Date: Tue, 26 Jul 2022 21:03:23 +0800
Subject: [PATCH] support epoll oneshot
---
src/lstack/api/lstack_epoll.c | 13 +++++++++++++
src/lstack/core/lstack_lwip.c | 1 -
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index 310a0e7..963a696 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -291,6 +291,12 @@ static int32_t epoll_lwip_event(struct wakeup_poll *wakeup, struct epoll_event *
list_for_each_safe(node, temp, &wakeup->event_list) {
struct lwip_sock *sock = container_of(node, struct lwip_sock, event_list);
+
+ if (sock->epoll_events == 0) {
+ list_del_node_null(&sock->event_list);
+ continue;
+ }
+
if (sock->conn && sock->conn->acceptmbox) {
accept_num++;
}
@@ -299,6 +305,13 @@ static int32_t epoll_lwip_event(struct wakeup_poll *wakeup, struct epoll_event *
list_del_node_null(&sock->event_list);
}
+ /* EPOLLONESHOT: generate event after epoll_ctl add/mod event again
+ epoll_event set 0 avoid generating event util epoll_ctl set epoll_event a valu */
+ if (sock->epoll_events & EPOLLONESHOT) {
+ list_del_node_null(&sock->event_list);
+ sock->epoll_events = 0;
+ }
+
events[event_num].events = sock->events;
events[event_num].data = sock->ep_data;
event_num++;
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index 4c2f0ea..80d781f 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -75,7 +75,6 @@ static void reset_sock_data(struct lwip_sock *sock)
sock->stack = NULL;
sock->wakeup = NULL;
sock->listen_next = NULL;
- sock->wait_close = false;
sock->epoll_events = 0;
sock->events = 0;
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。