1 Star 0 Fork 96

sky/gazelle_kylin_src

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0261-fix-bond4-EPOLLOUT-event-error.patch 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
compile_success 提交于 2023-12-04 02:54 . add select and timeout for kylin
From 0e6863306602e58e21932ed9b5fccf269e77e1da Mon Sep 17 00:00:00 2001
From: compile_success <980965867@qq.com>
Date: Wed, 28 Jun 2023 11:40:36 +0000
Subject: [PATCH] fix bond4 EPOLLOUT event error
---
src/lstack/api/lstack_epoll.c | 12 ++++++------
src/lstack/core/lstack_lwip.c | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index 06bd71b..55ca4fe 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -140,6 +140,11 @@ static void raise_pending_events(struct wakeup_poll *wakeup, struct lwip_sock *s
event |= EPOLLIN;
}
+ if (sock->errevent > 0) {
+ event |= EPOLLERR | EPOLLIN;
+ }
+
+ pthread_spin_lock(&wakeup->event_list_lock);
if (NETCONN_IS_OUTIDLE(sock)) {
/* lwip_netconn_do_connected set LIBOS FLAGS when connected */
if (sock->conn && CONN_TYPE_IS_LIBOS(sock->conn)) {
@@ -147,19 +152,14 @@ static void raise_pending_events(struct wakeup_poll *wakeup, struct lwip_sock *s
}
}
- if (sock->errevent > 0) {
- event |= EPOLLERR | EPOLLIN;
- }
-
if (event) {
- pthread_spin_lock(&wakeup->event_list_lock);
sock->events = event;
if (wakeup->type == WAKEUP_EPOLL && (sock->events & sock->epoll_events) &&
list_is_null(&sock->event_list)) {
list_add_node(&wakeup->event_list, &sock->event_list);
}
- pthread_spin_unlock(&wakeup->event_list_lock);
}
+ pthread_spin_unlock(&wakeup->event_list_lock);
}
int32_t lstack_do_epoll_create(int32_t fd)
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index d53591d..c1346f6 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -645,7 +645,7 @@ static inline bool replenish_send_ring(struct protocol_stack *stack, struct lwip
replenish_again = replenish_send_idlembuf(stack, sock);
- if ((sock->epoll_events & EPOLLOUT) && NETCONN_IS_OUTIDLE(sock)) {
+ if (NETCONN_IS_OUTIDLE(sock)) {
add_sock_event(sock, EPOLLOUT);
}
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nlgwcy/gazelle_kylin_src.git
git@gitee.com:nlgwcy/gazelle_kylin_src.git
nlgwcy
gazelle_kylin_src
gazelle_kylin_src
master

搜索帮助