Stop passing "http" to getaddrinfo in the case when we only need an IP
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 7 Dec 2012 19:04:20 +0000 (19:04 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 7 Dec 2012 19:04:20 +0000 (19:04 +0000)
address. It's legal to pass NULL as a service string, so I don't know
why I didn't do that in the first place.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@9722 cda61777-01e9-0310-a592-d414129be87e

httpd.c

diff --git a/httpd.c b/httpd.c
index daaea67..608287e 100644 (file)
--- a/httpd.c
+++ b/httpd.c
@@ -570,7 +570,7 @@ static int make_listening_sockets(struct listenfds *fds, const char *address,
     hints.ai_socktype = SOCK_STREAM;
     hints.ai_protocol = 0;
     hints.ai_flags = AI_PASSIVE;
-    ret = getaddrinfo(address, portstr ? portstr : "http", &hints, &addrs);
+    ret = getaddrinfo(address, portstr, &hints, &addrs);
     if (ret) {
         fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(ret));
         return -1;