mirror of
https://repo.or.cz/socat.git
synced 2025-07-13 23:13:24 +00:00
Catch service resolution failure
This commit is contained in:
parent
3efbf71430
commit
ea5beb8e75
3 changed files with 56 additions and 0 deletions
10
xio-ip.c
10
xio-ip.c
|
@ -238,6 +238,16 @@ int xiogetaddrinfo(const char *node, const char *service,
|
|||
continue;
|
||||
}
|
||||
if (error_num == EAI_SERVICE && protocol != 0) {
|
||||
if (hints.ai_protocol == 0) {
|
||||
Error7("getaddrinfo\"%s\", \"%s\", {%d,%d,%d,%d}, {}): %s",
|
||||
node?node:"NULL", service?service:"NULL",
|
||||
hints.ai_flags, hints.ai_family,
|
||||
hints.ai_socktype, hints.ai_protocol,
|
||||
gai_strerror(error_num));
|
||||
if (res != NULL) freeaddrinfo(res);
|
||||
if (numnode) free(numnode);
|
||||
return STAT_NORETRY;
|
||||
}
|
||||
hints.ai_protocol = 0;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue