代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From b90801a943f140a62761158a058d1076212dccf3 Mon Sep 17 00:00:00 2001
From: yangchen <yangchen145@huawei.com>
Date: Thu, 18 Jan 2024 10:01:52 +0800
Subject: [PATCH] udp: do not merge data into last pbuf
---
src/lstack/core/lstack_lwip.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index 87ec1f5..6ebe589 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -542,14 +542,14 @@ static ssize_t do_lwip_fill_sendring(struct lwip_sock *sock, const void *buf, si
}
struct protocol_stack *stack = sock->stack;
- if (!stack|| len == 0) {
+ if (!stack || len == 0) {
return 0;
}
ssize_t send_len = 0;
/* merge data into last pbuf */
- if (sock->remain_len) {
+ if (!NETCONN_IS_UDP(sock) && sock->remain_len) {
send_len = merge_data_lastpbuf(sock, (char *)buf, len);
if (send_len >= len) {
send_len = len;
@@ -1045,6 +1045,11 @@ ssize_t do_lwip_read_from_stack(int32_t fd, void *buf, size_t len, int32_t flags
calculate_lstack_latency(&sock->stack->latency, pbuf, GAZELLE_LATENCY_READ);
}
gazelle_ring_read_over(sock->recv_ring);
+
+ /* in udp, if pbuf remaining len less than copy_len, discard these packets */
+ if (recvd > 0 && NETCONN_IS_UDP(sock)) {
+ break;
+ }
}
}
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。