nghttpx: Pass NI_NUMERICSERV to getnameinfo to get numeric service name

This commit is contained in:
Tatsuhiro Tsujikawa 2014-12-06 01:07:05 +09:00
parent 3b03ff626a
commit b8dafbdf5e
1 changed files with 1 additions and 1 deletions

View File

@ -459,7 +459,7 @@ ClientHandler *accept_connection(event_base *evbase,
char service[NI_MAXSERV]; char service[NI_MAXSERV];
int rv; int rv;
rv = getnameinfo(addr, addrlen, host, sizeof(host), service, sizeof(service), rv = getnameinfo(addr, addrlen, host, sizeof(host), service, sizeof(service),
NI_NUMERICHOST); NI_NUMERICHOST | NI_NUMERICSERV);
if (rv != 0) { if (rv != 0) {
LOG(ERROR) << "getnameinfo() failed: " << gai_strerror(rv); LOG(ERROR) << "getnameinfo() failed: " << gai_strerror(rv);