mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
fix tapserver SIGPIPE handling on Linux
This commit is contained in:
parent
5d8a01cba7
commit
3e9ac1aaf3
@ -32,7 +32,7 @@ using ws_ssize_t = int;
|
|||||||
using ws_ssize_t = ssize_t;
|
using ws_ssize_t = ssize_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __LINUX__
|
#ifdef __linux__
|
||||||
#define SEND_FLAGS MSG_NOSIGNAL
|
#define SEND_FLAGS MSG_NOSIGNAL
|
||||||
#else
|
#else
|
||||||
#define SEND_FLAGS 0
|
#define SEND_FLAGS 0
|
||||||
@ -262,7 +262,13 @@ void TAPServerConnection::ReadThreadHandler()
|
|||||||
timeval timeout;
|
timeval timeout;
|
||||||
timeout.tv_sec = 0;
|
timeout.tv_sec = 0;
|
||||||
timeout.tv_usec = 50000;
|
timeout.tv_usec = 50000;
|
||||||
if (select(m_fd + 1, &rfds, nullptr, nullptr, &timeout) <= 0)
|
int select_res = select(m_fd + 1, &rfds, nullptr, nullptr, &timeout);
|
||||||
|
if (select_res < 0)
|
||||||
|
{
|
||||||
|
ERROR_LOG_FMT(SP1, "Can\'t poll tapserver fd: {}", Common::StrNetworkError());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (select_res == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// The tapserver protocol is very simple: there is a 16-bit little-endian
|
// The tapserver protocol is very simple: there is a 16-bit little-endian
|
||||||
|
@ -40,7 +40,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
const std::string m_destination;
|
const std::string m_destination;
|
||||||
const std::function<void(std::string&&)> m_recv_cb;
|
const RecvCallback m_recv_cb;
|
||||||
const std::size_t m_max_frame_size;
|
const std::size_t m_max_frame_size;
|
||||||
Common::SocketContext m_socket_context;
|
Common::SocketContext m_socket_context;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user