mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-19 09:02:26 +00:00
(Netplay) Do not try to receive new data if the data is in the buffer (#14345)
This commit is contained in:
parent
72cc98e9bd
commit
ea9dd022d6
@ -2370,7 +2370,7 @@ ssize_t netplay_recv(struct socket_buffer *sbuf, int sockfd,
|
||||
ssize_t recvd;
|
||||
bool error = false;
|
||||
|
||||
if (buf_used(sbuf) >= (sbuf->bufsz - 1))
|
||||
if (buf_unread(sbuf) >= len || !buf_remaining(sbuf))
|
||||
goto copy;
|
||||
|
||||
/* Receive whatever we can into the buffer */
|
||||
@ -2389,7 +2389,7 @@ ssize_t netplay_recv(struct socket_buffer *sbuf, int sockfd,
|
||||
{
|
||||
sbuf->end = 0;
|
||||
|
||||
if (sbuf->start > 1)
|
||||
if (sbuf->start > 1 && buf_unread(sbuf) < len)
|
||||
{
|
||||
error = false;
|
||||
recvd = socket_receive_all_nonblocking(sockfd, &error,
|
||||
|
Loading…
x
Reference in New Issue
Block a user