代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/lwip 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From e719fde7f90a1dff8daeb23170febb5ff38903c9 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Fri, 27 Oct 2023 19:19:42 +0800
Subject: [PATCH 77/77] adpat event for rtc mode
---
src/api/api_msg.c | 8 ++------
src/api/sockets.c | 33 ++++++++++++++++++++++++++++++---
src/include/eventpoll.h | 4 ++++
3 files changed, 36 insertions(+), 9 deletions(-)
diff --git a/src/api/api_msg.c b/src/api/api_msg.c
index 9a8992a..5e09505 100644
--- a/src/api/api_msg.c
+++ b/src/api/api_msg.c
@@ -293,11 +293,9 @@ recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p,
#endif /* LWIP_SO_RCVBUF */
#if GAZELLE_UDP_ENABLE
do_lwip_add_recvlist(conn->socket);
- LWIP_UNUSED_ARG(len);
-#else /* GAZELLE_UDP_ENABLE */
+#endif /* GAZELLE_UDP_ENABLE */
/* Register event with callback */
API_EVENT(conn, NETCONN_EVT_RCVPLUS, len);
-#endif /* GAZELLE_UDP_ENABLE */
}
}
#endif /* LWIP_UDP */
@@ -357,11 +355,9 @@ recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
#endif /* LWIP_SO_RCVBUF */
#if GAZELLE_ENABLE
do_lwip_add_recvlist(conn->socket);
- LWIP_UNUSED_ARG(len);
-#else
+#endif
/* Register event with callback */
API_EVENT(conn, NETCONN_EVT_RCVPLUS, len);
-#endif
}
return ERR_OK;
diff --git a/src/api/sockets.c b/src/api/sockets.c
index 1d71427..d62290d 100644
--- a/src/api/sockets.c
+++ b/src/api/sockets.c
@@ -2744,29 +2744,56 @@ event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len)
check_waiters = 0;
}
#if GAZELLE_ENABLE
- if (conn->acceptmbox != NULL && !sys_mbox_empty(conn->acceptmbox)) {
- add_sock_event(sock, POLLIN);
+ if (netif_is_rtc_mode(netif_default)) {
+ if (sock->rcvevent == 1) {
+ add_sock_event_nolock(sock, POLLIN);
+ }
+ } else {
+ if (conn->acceptmbox != NULL && !sys_mbox_empty(conn->acceptmbox)) {
+ add_sock_event(sock, POLLIN);
+ }
}
#endif
break;
case NETCONN_EVT_RCVMINUS:
sock->rcvevent--;
check_waiters = 0;
+#if GAZELLE_ENABLE
+ if (netif_is_rtc_mode(netif_default)) {
+ if (sock->rcvevent == 0) {
+ del_sock_event_nolock(sock, POLLIN);
+ }
+ }
+#endif
break;
case NETCONN_EVT_SENDPLUS:
if (sock->sendevent) {
check_waiters = 0;
}
sock->sendevent = 1;
+#if GAZELLE_ENABLE
+ if (netif_is_rtc_mode(netif_default)) {
+ add_sock_event_nolock(sock, POLLOUT);
+ }
+#endif
break;
case NETCONN_EVT_SENDMINUS:
sock->sendevent = 0;
check_waiters = 0;
+#if GAZELLE_ENABLE
+ if (netif_is_rtc_mode(netif_default)) {
+ del_sock_event_nolock(sock, POLLOUT);
+ }
+#endif
break;
case NETCONN_EVT_ERROR:
sock->errevent = 1;
#if GAZELLE_ENABLE
- add_sock_event(sock, EPOLLERR);
+ if (netif_is_rtc_mode(netif_default)) {
+ add_sock_event_nolock(sock, EPOLLERR);
+ } else {
+ add_sock_event(sock, EPOLLERR);
+ }
#endif
break;
default:
diff --git a/src/include/eventpoll.h b/src/include/eventpoll.h
index dd65a4d..5bc5206 100644
--- a/src/include/eventpoll.h
+++ b/src/include/eventpoll.h
@@ -66,6 +66,10 @@ struct libos_epoll {
struct lwip_sock;
extern void add_sock_event(struct lwip_sock *sock, uint32_t event);
+extern void add_sock_event_nolock(struct lwip_sock *sock, uint32_t event);
+extern void del_sock_event(struct lwip_sock *sock, uint32_t event);
+extern void del_sock_event_nolock(struct lwip_sock *sock, uint32_t event);
+
extern int32_t lstack_epoll_close(int32_t);
#endif /* __EVENTPOLL_H__ */
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。