代码拉取完成,页面将自动刷新
同步操作将从 compile_success/gazelle_kylin_src 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 6b05f21de47d2e3a49e6d99ee8a6af773266f117 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng12@huawei.com>
Date: Fri, 18 Mar 2022 14:54:37 +0800
Subject: [PATCH] the sending of sock last data is triggered by lstack
---
src/lstack/core/lstack_lwip.c | 5 +++--
src/lstack/core/lstack_protocol_stack.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index 7bab92f..b4d75d2 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -214,7 +214,7 @@ void stack_replenish_send_idlembuf(struct protocol_stack *stack)
uint32_t replenish_cnt = rte_ring_free_count(stack->send_idle_ring);
for (uint32_t i = 0; i < replenish_cnt; i++) {
- struct pbuf *pbuf = lwip_alloc_pbuf(PBUF_TRANSPORT, MAX_PACKET_SZ - PBUF_TRANSPORT, PBUF_RAM);
+ struct pbuf *pbuf = lwip_alloc_pbuf(PBUF_TRANSPORT, TCP_MSS, PBUF_RAM);
if (pbuf == NULL) {
break;
}
@@ -361,7 +361,8 @@ void stack_send(struct rpc_msg *msg)
msg->result = write_lwip_data(sock, fd, flags);
__atomic_store_n(&sock->have_rpc_send, false, __ATOMIC_RELEASE);
- if (msg->result >= 0 && rte_ring_count(sock->send_ring)) {
+ if (msg->result >= 0 &&
+ (rte_ring_count(sock->send_ring) || sock->send_lastdata)) {
if (list_is_empty(&sock->send_list)) {
__atomic_store_n(&sock->have_rpc_send, true, __ATOMIC_RELEASE);
list_add_node(&stack->send_list, &sock->send_list);
diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c
index 1de546d..e5761a4 100644
--- a/src/lstack/core/lstack_protocol_stack.c
+++ b/src/lstack/core/lstack_protocol_stack.c
@@ -350,7 +350,8 @@ static void send_stack_list(struct protocol_stack *stack)
ssize_t ret = write_lwip_data(sock, sock->conn->socket, sock->send_flags);
__atomic_store_n(&sock->have_rpc_send, false, __ATOMIC_RELEASE);
- if (ret >= 0 && rte_ring_count(sock->send_ring)) {
+ if (ret >= 0 &&
+ (rte_ring_count(sock->send_ring) || sock->send_lastdata)) {
__atomic_store_n(&sock->have_rpc_send, true, __ATOMIC_RELEASE);
} else {
list_del_node_init(&sock->send_list);
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。