mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-16 06:23:23 +09:00
[MG_Remote, MG_Test, scripts] (P7): bound the pre-auth cap and pause accepting when out of descriptors
This commit is contained in:
@@ -486,7 +486,13 @@ namespace MobileGL::MG_Remote::Transport {
|
||||
if (fd < 0) {
|
||||
// The same two non-failures AcceptPair re-polls on.
|
||||
if (errno == EINTR || errno == ECONNABORTED) continue;
|
||||
WireLogError("MG_Remote SocketTransport: accept failed: %s", std::strerror(errno));
|
||||
const int error = errno;
|
||||
WireLogError("MG_Remote SocketTransport: accept failed: %s", std::strerror(error));
|
||||
// Out of descriptors or memory is the PROCESS's state, not the listener's: the
|
||||
// connection waits in the backlog (f2-auth fix round; the TCP supervisor pauses
|
||||
// and retries instead of exiting 73).
|
||||
if (error == EMFILE || error == ENFILE || error == ENOBUFS || error == ENOMEM)
|
||||
return MOBILEGL_ERR_OUT_OF_MEMORY;
|
||||
return MOBILEGL_ERR_TRANSPORT_CLOSED;
|
||||
}
|
||||
::fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
|
||||
Reference in New Issue
Block a user