h_addr is a define in in netdb.h
[oweals/gnunet.git] / src / transport / plugin_transport_http_server.c
index abf3fdacdfc69d2751a37e725faa4b169b3177e6..d102880eb2f38d9c8896e9de96c355bab38eb3b3 100644 (file)
@@ -654,35 +654,33 @@ static int
 http_server_plugin_address_suggested (void *cls, const void *addr,
                size_t addrlen)
 {
-  struct HttpAddressWrapper *next;
-  struct HttpAddressWrapper *pos;
-       struct HttpAddress *h_addr;
-       h_addr = (struct HttpAddress *) addr;
-
-  if ((NULL != p->ext_addr) &&
-          GNUNET_YES == (http_common_cmp_addresses (addr, addrlen,
-                                          p->ext_addr, p->ext_addr_len)))
-  {
-       /* Checking HTTP_OPTIONS_VERIFY_CERTIFICATE option for external hostname */
-       if ((ntohl(h_addr->options) & HTTP_OPTIONS_VERIFY_CERTIFICATE) !=
-                       (p->options & HTTP_OPTIONS_VERIFY_CERTIFICATE))
+       struct HttpAddressWrapper *next;
+       struct HttpAddressWrapper *pos;
+       const struct HttpAddress *haddr = addr;
+
+       if ((NULL != p->ext_addr) &&
+                GNUNET_YES == (http_common_cmp_addresses (addr, addrlen,
+                                                                p->ext_addr, p->ext_addr_len)))
+       {
+               /* Checking HTTP_OPTIONS_VERIFY_CERTIFICATE option for external hostname */
+               if ((ntohl(haddr->options) & HTTP_OPTIONS_VERIFY_CERTIFICATE) !=
+                               (p->options & HTTP_OPTIONS_VERIFY_CERTIFICATE))
                        return GNUNET_NO; /* VERIFY option not set as required! */
-       return GNUNET_OK;
-  }
-
-  next  = p->addr_head;
-  while (NULL != (pos = next))
-  {
-    next = pos->next;
-    if (GNUNET_YES == (http_common_cmp_addresses(addr,
-                                                 addrlen,
-                                                 pos->address,
-                                                 pos->addrlen)))
-      return GNUNET_OK;
-
-  }
-
-  return GNUNET_NO;
+               return GNUNET_OK;
+       }
+
+       next  = p->addr_head;
+       while (NULL != (pos = next))
+       {
+               next = pos->next;
+               if (GNUNET_YES == (http_common_cmp_addresses(addr,
+                                                                                                                                                                                                addrlen,
+                                                                                                                                                                                                pos->address,
+                                                                                                                                                                                                pos->addrlen)))
+                       return GNUNET_OK;
+
+       }
+       return GNUNET_NO;
 }