http: rename bind_socket_ai() to create_bind_socket_nonblock()
authoryuangongji <82787816@qq.com>
Wed, 18 Sep 2019 20:12:59 +0000 (23:12 +0300)
committerAzat Khuzhin <azat@libevent.org>
Wed, 18 Sep 2019 20:13:34 +0000 (23:13 +0300)
http.c

diff --git a/http.c b/http.c
index 9d326706a68e9526dcb73801df5af53a10e911d6..533915d20c2bb36473c591bfede5a2466a56b304 100644 (file)
--- a/http.c
+++ b/http.c
@@ -177,7 +177,7 @@ fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
 
 extern int debug;
 
-static evutil_socket_t bind_socket_ai(struct evutil_addrinfo *, int reuse);
+static evutil_socket_t create_bind_socket_nonblock(struct evutil_addrinfo *, int reuse);
 static evutil_socket_t bind_socket(const char *, ev_uint16_t, int reuse);
 static void name_from_addr(struct sockaddr *, ev_socklen_t, char **, char **);
 static struct evhttp_uri *evhttp_uri_parse_authority(char *source_uri);
@@ -4604,9 +4604,8 @@ name_from_addr(struct sockaddr *sa, ev_socklen_t salen,
 }
 
 /* Create a non-blocking socket and bind it */
-/* todo: rename this function */
 static evutil_socket_t
-bind_socket_ai(struct evutil_addrinfo *ai, int reuse)
+create_bind_socket_nonblock(struct evutil_addrinfo *ai, int reuse)
 {
        evutil_socket_t fd;
 
@@ -4680,14 +4679,14 @@ bind_socket(const char *address, ev_uint16_t port, int reuse)
 
        /* just create an unbound socket */
        if (address == NULL && port == 0)
-               return bind_socket_ai(NULL, 0);
+               return create_bind_socket_nonblock(NULL, 0);
 
        aitop = make_addrinfo(address, port);
 
        if (aitop == NULL)
                return (-1);
 
-       fd = bind_socket_ai(aitop, reuse);
+       fd = create_bind_socket_nonblock(aitop, reuse);
 
        evutil_freeaddrinfo(aitop);