Don't treat unsupported protocols as fatal errors

This commit is contained in:
Israel Lot
2019-03-12 18:24:22 -05:00
parent c29f997835
commit 864f8d2673
2 changed files with 9 additions and 0 deletions
+5
View File
@@ -30,6 +30,10 @@ extern "C"
{
#endif
#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT /* Socket type not supported */
#define EPFNOSUPPORT WSAEPFNOSUPPORT /* Protocol family not supported */
/* Converts error codes returned by GetLastError/WSAGetLastError to errno codes */
int translate_sys_error(int sys_error);
void set_errno_from_last_error();
@@ -37,6 +41,7 @@ void set_errno_from_last_error();
int strerror_r(int err, char* buf, size_t buflen);
char *wsa_strerror(int err);
#ifdef __cplusplus
}
#endif
+4
View File
@@ -1830,6 +1830,10 @@ int listenToPort(int port, int *fds, int *count) {
"Creating Server TCP listening socket %s:%d: %s",
server.bindaddr[j] ? server.bindaddr[j] : "*",
port, server.neterr);
if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT ||
errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT ||
errno == EAFNOSUPPORT || errno == EADDRNOTAVAIL)
continue;
return C_ERR;
}
anetNonBlock(NULL, fds[*count]);