+ struct addrinfo hints, *af = 0, *ai;
+ int error;
+ int ipv6_only = -1;
+
+ yaz_log(YLOG_LOG, "HTTP listener %s:%s", server->host, server->port);
+
+ hints.ai_flags = 0;
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = 0;
+ hints.ai_addrlen = 0;
+ hints.ai_addr = NULL;
+ hints.ai_canonname = NULL;
+ hints.ai_next = NULL;
+
+ if (!strcmp(server->host, "@"))
+ {
+ ipv6_only = 0;
+ hints.ai_flags = AI_PASSIVE;
+ error = getaddrinfo(0, server->port, &hints, &af);
+ }
+ else
+ error = getaddrinfo(server->host, server->port, &hints, &af);