mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-23 03:10:14 +00:00
Error reporting when a password is refused, plus a bugfix so that
socket_receive_all_nonblocking actually reports disconnects.
This commit is contained in:
parent
df2600fbf4
commit
a6cd8c3aa1
@ -74,9 +74,16 @@ ssize_t socket_receive_all_nonblocking(int fd, bool *error,
|
||||
const uint8_t *data = (const uint8_t*)data_;
|
||||
ssize_t ret = recv(fd, (char*)data, size, 0);
|
||||
|
||||
if (ret >= 0)
|
||||
if (ret > 0)
|
||||
return ret;
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
/* Socket closed */
|
||||
*error = true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (isagain(ret))
|
||||
return 0;
|
||||
|
||||
|
@ -677,7 +677,12 @@ bool netplay_handshake_pre_sync(netplay_t *netplay,
|
||||
retro_ctx_memory_info_t mem_info;
|
||||
|
||||
RECV(cmd, sizeof(cmd))
|
||||
{
|
||||
char *msg = "Incorrect password.";
|
||||
RARCH_ERR("%s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Only expecting a sync command */
|
||||
if (ntohl(cmd[0]) != NETPLAY_CMD_SYNC ||
|
||||
|
Loading…
Reference in New Issue
Block a user