mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
added SetSocketOptions:53: Unreachable code! Unknown level =65535 optname =4608
This commit is contained in:
parent
cecd159c0e
commit
4a1a0e6a38
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <common/assert.h>
|
#include <common/assert.h>
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
#include "net_error.h"
|
||||||
#include "sockets.h"
|
#include "sockets.h"
|
||||||
|
|
||||||
namespace Libraries::Net {
|
namespace Libraries::Net {
|
||||||
@ -51,6 +52,17 @@ int PosixSocket::SetSocketOptions(int level, int optname, const void* optval, un
|
|||||||
case ORBIS_NET_SO_SNDTIMEO:
|
case ORBIS_NET_SO_SNDTIMEO:
|
||||||
return ConvertReturnErrorCode(
|
return ConvertReturnErrorCode(
|
||||||
setsockopt(sock, level, SO_SNDTIMEO, (const char*)optval, optlen));
|
setsockopt(sock, level, SO_SNDTIMEO, (const char*)optval, optlen));
|
||||||
|
case ORBIS_NET_SO_NBIO: {
|
||||||
|
if (optlen != sizeof(sockopt_so_nbio)) {
|
||||||
|
return ORBIS_NET_ERROR_EFAULT;
|
||||||
|
}
|
||||||
|
memcpy(&sockopt_so_nbio, optval, optlen);
|
||||||
|
#ifdef _WIN32
|
||||||
|
return ConvertReturnErrorCode(ioctlsocket(sock, FIONBIO, (u_long*)&sockopt_so_nbio));
|
||||||
|
#else
|
||||||
|
return ConvertReturnErrorCode(ioctl(sock, FIONBIO, &sockopt_so_nbio));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UNREACHABLE_MSG("Unknown level ={} optname ={}", level, optname);
|
UNREACHABLE_MSG("Unknown level ={} optname ={}", level, optname);
|
||||||
|
@ -42,6 +42,7 @@ struct Socket {
|
|||||||
|
|
||||||
struct PosixSocket : public Socket {
|
struct PosixSocket : public Socket {
|
||||||
net_socket sock;
|
net_socket sock;
|
||||||
|
int sockopt_so_nbio = 0;
|
||||||
explicit PosixSocket(int domain, int type, int protocol)
|
explicit PosixSocket(int domain, int type, int protocol)
|
||||||
: Socket(domain, type, protocol), sock(socket(domain, type, protocol)) {}
|
: Socket(domain, type, protocol), sock(socket(domain, type, protocol)) {}
|
||||||
int SetSocketOptions(int level, int optname, const void* optval, unsigned int optlen) override;
|
int SetSocketOptions(int level, int optname, const void* optval, unsigned int optlen) override;
|
||||||
|
Loading…
Reference in New Issue
Block a user