shrpx: Log IP version number when getaddrinfo failed

This commit is contained in:
Tatsuhiro Tsujikawa 2013-01-09 21:30:57 +09:00
parent 6da492c4e8
commit 4d1f1f2395
1 changed files with 2 additions and 1 deletions

View File

@ -147,7 +147,8 @@ evconnlistener* create_evlistener(ListenHandler *handler, int family)
addrinfo *res, *rp; addrinfo *res, *rp;
r = getaddrinfo(get_config()->host, service, &hints, &res); r = getaddrinfo(get_config()->host, service, &hints, &res);
if(r != 0) { if(r != 0) {
LOG(INFO) << "Unable to get address for " << get_config()->host << ": " LOG(INFO) << "Unable to get IPv" << (family == AF_INET ? "4" : "6")
<< " address for " << get_config()->host << ": "
<< gai_strerror(r); << gai_strerror(r);
return NULL; return NULL;
} }