From 7b8ef5dc1b1680a072d76198694940ede7ecb43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E8=B6=85=E4=BC=97?= Date: Tue, 10 Jan 2023 18:31:35 +0800 Subject: [PATCH] usrsock: only TCP data should be aggregrated for rpmsg case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit non-streaming socket's rx data should not be aggregrated. Signed-off-by: 梁超众 --- drivers/usrsock/usrsock_rpmsg_server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usrsock/usrsock_rpmsg_server.c b/drivers/usrsock/usrsock_rpmsg_server.c index 56d423efcb..7a56382349 100644 --- a/drivers/usrsock/usrsock_rpmsg_server.c +++ b/drivers/usrsock/usrsock_rpmsg_server.c @@ -533,7 +533,8 @@ static int usrsock_rpmsg_recvfrom_handler(FAR struct rpmsg_endpoint *ept, outaddrlen ? (FAR struct sockaddr *)(ack + 1) : NULL, outaddrlen ? &outaddrlen : NULL); totlen = ret; - if (ret > 0) + if (ret > 0 && (priv->socks[req->usockid].s_type & SOCK_TYPE_MASK) == + SOCK_STREAM) { if (outaddrlen < inaddrlen) {