1 Star 0 Fork 48

flying-eagle/lwip

forked from src-openEuler/lwip 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0017-support-REUSEPOR-option.patch 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2022-03-03 17:12 . support REUSEPORT
From 670f888704c7bbb1121e63bc380ca34b83c43464 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng12@huawei.com>
Date: Thu, 3 Mar 2022 17:06:03 +0800
Subject: [PATCH] support REUSEPOR option fix rpc msg too much
fix recurring events
---
src/api/sockets.c | 4 ++++
src/include/lwipsock.h | 10 ++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/api/sockets.c b/src/api/sockets.c
index b032ce9..4b682f3 100644
--- a/src/api/sockets.c
+++ b/src/api/sockets.c
@@ -3029,6 +3029,10 @@ lwip_sockopt_to_ipopt(int optname)
return SOF_KEEPALIVE;
case SO_REUSEADDR:
return SOF_REUSEADDR;
+#if USE_LIBOS
+ case SO_REUSEPORT:
+ return SO_REUSEPORT;
+#endif
default:
LWIP_ASSERT("Unknown socket option", 0);
return 0;
diff --git a/src/include/lwipsock.h b/src/include/lwipsock.h
index 069cdcb..e2519ff 100644
--- a/src/include/lwipsock.h
+++ b/src/include/lwipsock.h
@@ -94,7 +94,8 @@ struct lwip_sock {
#if USE_LIBOS
uint32_t epoll_events; /* registered events */
uint32_t events; /* available events */
- int32_t in_event; /* avoid recurring events */
+ volatile bool have_event; /* avoid recurring events */
+ volatile bool have_rpc_send; /* avoid recurring rpc_send */
epoll_data_t ep_data;
struct weakup_poll *weakup;
struct protocol_stack *stack;
@@ -103,8 +104,13 @@ struct lwip_sock {
struct pbuf *send_lastdata; /* unread data in one pbuf */
void *send_ring;
int32_t recv_flags;
- int32_t nextfd; /* listenfd list */
+ bool wait_close;
+ int32_t attach_fd;
+ struct lwip_sock *shadowed_sock;
+ struct list_node attach_list;
+ struct list_node listen_list;
struct list_node recv_list;
+ int32_t nextfd; /* listenfd list */
#endif
};
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/flying-eagle12138/lwip.git
git@gitee.com:flying-eagle12138/lwip.git
flying-eagle12138
lwip
lwip
master

搜索帮助