Don't treat unsupported protocols as fatal errors
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user