代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 34a090b2cfb88cb2e711d02c0f3eddf3a3656fac Mon Sep 17 00:00:00 2001
From: compile_success <980965867@qq.com>
Date: Fri, 19 Jul 2024 07:34:47 +0000
Subject: [PATCH] support kernel connect
---
src/lstack/api/lstack_epoll.c | 2 +-
src/lstack/api/lstack_wrap.c | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index 417499b..6426de4 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -439,7 +439,7 @@ int32_t lstack_rtw_epoll_ctl(int32_t epfd, int32_t op, int32_t fd, struct epoll_
struct wakeup_poll *wakeup = epoll_sock->wakeup;
struct lwip_sock *sock = lwip_get_socket(fd);
- if (POSIX_IS_CLOSED(sock)) {
+ if (POSIX_IS_CLOSED(sock) || POSIX_IS_TYPE(sock, POSIX_KERNEL)) {
return posix_api->epoll_ctl_fn(epfd, op, fd, event);
}
diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c
index b19990e..a6ea485 100644
--- a/src/lstack/api/lstack_wrap.c
+++ b/src/lstack/api/lstack_wrap.c
@@ -317,8 +317,16 @@ static int32_t do_connect(int32_t s, const struct sockaddr *name, socklen_t name
ret = posix_api->connect_fn(s, name, namelen);
POSIX_SET_TYPE(sock, POSIX_KERNEL);
} else {
+ /* When the socket is POSIX_LWIP_OR_KERNEL, connect to lwip first and then connect to kernel. */
ret = g_wrap_api->connect_fn(s, name, namelen);
- POSIX_SET_TYPE(sock, POSIX_LWIP);
+ if (ret == 0) {
+ POSIX_SET_TYPE(sock, POSIX_LWIP);
+ } else {
+ ret = posix_api->connect_fn(s, name, namelen);
+ if (ret == 0) {
+ POSIX_SET_TYPE(sock, POSIX_KERNEL);
+ }
+ }
}
return ret;
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。