diff options
-rw-r--r-- | plop.c | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -166,7 +166,33 @@ int handle_server(lua_State * L, const int efd, const int server) const int client = accept(server, NULL, NULL); if (-1 == client) { - return -1; // TODO: Consider not crashing entire server because of one accept. + switch (errno) + { + case EAGAIN: +#if EWOULDBLOCK != EAGAIN + case EWOULDBLOCK: +#endif + case ENETDOWN: + case EPROTO: + case ENOPROTOOPT: + case EHOSTDOWN: + case ENONET: + case EHOSTUNREACH: + case EOPNOTSUPP: + case ENETUNREACH: + case ECONNABORTED: + case EMFILE: + case ENFILE: + case ENOBUFS: + case ENOMEM: + { + return 0; + } + default: + { + return -1; + } + } } // TODO: Request is not the enitre state of the client. Make them distinct along with responses. |