avoid duplicate binds
authorChristian Grothoff <christian@grothoff.org>
Mon, 20 Jun 2011 09:15:18 +0000 (09:15 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 20 Jun 2011 09:15:18 +0000 (09:15 +0000)
src/util/service.c
src/util/test_resolver_api.c

index a82b9d12b802ee05eb6470323a462449a3c7428e..1e70e3ada5430bbe710378c3dc11e730836c3166 100644 (file)
@@ -1024,6 +1024,10 @@ GNUNET_SERVICE_get_server_addresses (const char *serviceName,
          next = pos->ai_next;
          if ( (disablev6) && (pos->ai_family == AF_INET6))
            continue;
+         if (pos->ai_protocol != IPPROTO_TCP)
+           continue; /* not TCP */
+         if (pos->ai_socktype != SOCK_STREAM)
+           continue; /* huh? */
 #if DEBUG_SERVICE
          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                      "Service `%s' will bind to `%s'\n",
index be631e36f259ac38b42251b4432790239a132aba..39cfa43fc4c3982e6b26d39780ac1328e11a7a47 100644 (file)
@@ -359,7 +359,6 @@ run(void *cls, char * const *args,
 
   GNUNET_RESOLVER_ip_get("localhost", AF_INET, timeout, &check_127,
                         cls);
-  fprintf (stderr, "Trying to get hostname for 127.0.0.1\n");
   GNUNET_RESOLVER_hostname_get((const struct sockaddr *) &sa,
       sizeof(struct sockaddr), GNUNET_YES, timeout, &check_localhost, cls);