1 Star 0 Fork 96

sky/gazelle_kylin_src

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0224-optimize-do_close.patch 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
compile_success 提交于 2023-12-04 02:54 . add select and timeout for kylin
From 22405fd936105e4178a617d46077c871835ac6d5 Mon Sep 17 00:00:00 2001
From: wangweizZZ <wangwei7_yewu@cmss.chinamobile.com>
Date: Mon, 27 Mar 2023 21:46:59 +0800
Subject: [PATCH] optimize do_close
---
src/lstack/api/lstack_wrap.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c
index aacb30c..ae08bfe 100644
--- a/src/lstack/api/lstack_wrap.c
+++ b/src/lstack/api/lstack_wrap.c
@@ -521,15 +521,13 @@ static inline ssize_t do_sendmsg(int32_t s, const struct msghdr *message, int32_
static inline int32_t do_close(int32_t s)
{
- struct lwip_sock *sock = get_socket_by_fd(s);
- if (likely(posix_api->ues_posix == 0) && sock && sock->wakeup && sock->wakeup->epollfd == s) {
- return lstack_epoll_close(s);
- }
-
+ struct lwip_sock *sock = NULL;
if (select_path(s, &sock) == PATH_KERNEL) {
return posix_api->close_fn(s);
}
-
+ if (sock && sock->wakeup && sock->wakeup->epollfd == s) {
+ return lstack_epoll_close(s);
+ }
return stack_broadcast_close(s);
}
--
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

搜索帮助