X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fgetaddrinfo.c;h=4bce64eb3633c21519140426b5b6fa174726db38;hb=37482a306afb1c7952bdf304530498b6d068db92;hp=656b9e197175240d8d379a9f85ef6b2903546236;hpb=2e17f8b4117fdbefd1c1b6452c7a39c1dab03207;p=pazpar2-moved-to-github.git diff --git a/src/getaddrinfo.c b/src/getaddrinfo.c index 656b9e1..4bce64e 100644 --- a/src/getaddrinfo.c +++ b/src/getaddrinfo.c @@ -61,6 +61,7 @@ struct work { char *ipport; /* result or NULL if it could not be resolved */ struct host *host; /* host that we're dealing with - mother thread */ iochan_man_t iochan_man; /* iochan manager */ + int error; }; static int log_level = YLOG_LOG; @@ -106,6 +107,7 @@ static void perform_getaddrinfo(struct work *w) { yaz_log(YLOG_WARN, "Failed to resolve %s: %s", w->hostport, gai_strerror(error)); + w->error = error; } else { @@ -157,6 +159,7 @@ void iochan_handler(struct iochan *i, int event) { struct work *w = sel_thread_result(p); w->host->ipport = w->ipport; + w->host->error = w->error; connect_resolver_host(w->host, w->iochan_man); xfree(w); } @@ -196,6 +199,7 @@ int host_getaddrinfo(struct host *host, iochan_man_t iochan_man) w->ipport = 0; w->host = host; w->iochan_man = iochan_man; + w->error = 0; #if USE_THREADED_RESOLVER if (use_thread) { @@ -208,6 +212,7 @@ int host_getaddrinfo(struct host *host, iochan_man_t iochan_man) #endif perform_getaddrinfo(w); host->ipport = w->ipport; + host->error = w->error; xfree(w); if (!host->ipport) return -1;