mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
net/usrsock: increase the send/recv() length limit to UINT32_MAX
change request type to uint32_t to the impove the throughput Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
@@ -154,8 +154,8 @@ begin_packed_struct struct usrsock_request_sendto_s
|
|||||||
|
|
||||||
int16_t usockid;
|
int16_t usockid;
|
||||||
int32_t flags;
|
int32_t flags;
|
||||||
|
uint32_t buflen;
|
||||||
uint16_t addrlen;
|
uint16_t addrlen;
|
||||||
uint16_t buflen;
|
|
||||||
} end_packed_struct;
|
} end_packed_struct;
|
||||||
|
|
||||||
begin_packed_struct struct usrsock_request_recvfrom_s
|
begin_packed_struct struct usrsock_request_recvfrom_s
|
||||||
@@ -164,7 +164,7 @@ begin_packed_struct struct usrsock_request_recvfrom_s
|
|||||||
|
|
||||||
int16_t usockid;
|
int16_t usockid;
|
||||||
int32_t flags;
|
int32_t flags;
|
||||||
uint16_t max_buflen;
|
uint32_t max_buflen;
|
||||||
uint16_t max_addrlen;
|
uint16_t max_addrlen;
|
||||||
} end_packed_struct;
|
} end_packed_struct;
|
||||||
|
|
||||||
|
|||||||
@@ -159,9 +159,9 @@ static int do_recvfrom_request(FAR struct usrsock_conn_s *conn,
|
|||||||
addrlen = UINT16_MAX;
|
addrlen = UINT16_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buflen > UINT16_MAX)
|
if (buflen > UINT32_MAX)
|
||||||
{
|
{
|
||||||
buflen = UINT16_MAX;
|
buflen = UINT32_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare request for daemon to read. */
|
/* Prepare request for daemon to read. */
|
||||||
|
|||||||
@@ -159,9 +159,9 @@ static int do_sendto_request(FAR struct usrsock_conn_s *conn,
|
|||||||
req.buflen += msg->msg_iov[i].iov_len;
|
req.buflen += msg->msg_iov[i].iov_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.buflen > UINT16_MAX)
|
if (req.buflen > UINT32_MAX)
|
||||||
{
|
{
|
||||||
req.buflen = UINT16_MAX;
|
req.buflen = UINT32_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
bufs[0].iov_base = (FAR void *)&req;
|
bufs[0].iov_base = (FAR void *)&req;
|
||||||
|
|||||||
Reference in New Issue
Block a user