mirror of https://github.com/yandex/odyssey.git
odissey: fix getaddrinfo rc check
This commit is contained in:
parent
94cd277b68
commit
1ec7527ea4
|
@ -274,7 +274,7 @@ od_backend_connect_to(od_server_t *server,
|
|||
snprintf(port, sizeof(port), "%d", server_scheme->port);
|
||||
struct addrinfo *ai = NULL;
|
||||
rc = machine_getaddrinfo(server_scheme->host, port, NULL, &ai, 0);
|
||||
if (rc == -1) {
|
||||
if (rc != 0) {
|
||||
od_error_server(&instance->log, server->id, context,
|
||||
"failed to resolve %s:%d",
|
||||
server_scheme->host,
|
||||
|
|
|
@ -181,7 +181,7 @@ od_pooler_main(od_pooler_t *pooler)
|
|||
struct addrinfo *ai = NULL;
|
||||
int rc;
|
||||
rc = machine_getaddrinfo(host, port, hints_ptr, &ai, UINT32_MAX);
|
||||
if (rc == -1) {
|
||||
if (rc != 0) {
|
||||
od_error(&instance->log, "pooler", "failed to resolve %s:%d",
|
||||
instance->scheme.host,
|
||||
instance->scheme.port);
|
||||
|
@ -189,7 +189,11 @@ od_pooler_main(od_pooler_t *pooler)
|
|||
}
|
||||
pooler->addr = ai;
|
||||
|
||||
/* listen on every resolved address */
|
||||
/* listen resolved addresses */
|
||||
if (host) {
|
||||
od_pooler_server_start(pooler, ai);
|
||||
return;
|
||||
}
|
||||
while (ai) {
|
||||
od_pooler_server_start(pooler, ai);
|
||||
ai = ai->ai_next;
|
||||
|
|
Loading…
Reference in New Issue