[tor-commits] [tor/master] Rename is_tcp in connection_listener_new(), since AF_UNIX means SOCK_STREAM no longer implies TCP

nickm at torproject.org nickm at torproject.org
Tue Jan 13 18:11:44 UTC 2015


commit 48633c07660216d3b852b609c44fa318d55908f0
Author: Andrea Shepard <andrea at torproject.org>
Date:   Wed Jan 7 19:45:59 2015 +0000

    Rename is_tcp in connection_listener_new(), since AF_UNIX means SOCK_STREAM no longer implies TCP
---
 src/or/connection.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index bb2cff3..c17a414 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1084,8 +1084,8 @@ connection_listener_new(const struct sockaddr *listensockaddr,
       listensockaddr->sa_family == AF_INET6 ||
       (listensockaddr->sa_family == AF_UNIX &&
        type != CONN_TYPE_CONTROL_LISTENER)) {
-    int is_tcp = (type != CONN_TYPE_AP_DNS_LISTENER);
-    if (is_tcp)
+    int is_stream = (type != CONN_TYPE_AP_DNS_LISTENER);
+    if (is_stream)
       start_reading = 1;
 
     if ( listensockaddr->sa_family == AF_INET ||
@@ -1097,8 +1097,8 @@ connection_listener_new(const struct sockaddr *listensockaddr,
                  conn_type_to_string(type), fmt_addrport(&addr, usePort));
 
       s = tor_open_socket_nonblocking(tor_addr_family(&addr),
-        is_tcp ? SOCK_STREAM : SOCK_DGRAM,
-        is_tcp ? IPPROTO_TCP: IPPROTO_UDP);
+        is_stream ? SOCK_STREAM : SOCK_DGRAM,
+        is_stream ? IPPROTO_TCP: IPPROTO_UDP);
       if (!SOCKET_OK(s)) {
         log_warn(LD_NET, "Socket creation failed: %s",
                  tor_socket_strerror(tor_socket_errno(-1)));
@@ -1228,7 +1228,7 @@ connection_listener_new(const struct sockaddr *listensockaddr,
         goto err;
       }
 
-      if (is_tcp) {
+      if (is_stream) {
         if (tor_listen(s) < 0) {
           log_warn(LD_NET, "Could not listen on %s:%u: %s", address, usePort,
                    tor_socket_strerror(tor_socket_errno(s)));





More information about the tor-commits mailing list