h_addr is a define in in netdb.h
[oweals/gnunet.git] / src / transport / plugin_transport_http_server.c
index 56477625f69ebd88d06f86b91efb8f1ce342e256..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;
 }
 
 
@@ -1424,7 +1422,7 @@ server_access_cb (void *cls, struct MHD_Connection *mhd_connection,
     response = MHD_create_response_from_data (strlen ("Thank you!"),
                                        "Thank you!",
                                        MHD_NO, MHD_NO);
-    res = MHD_queue_response (mhd_connection, MHD_HTTP_OK, response);
+    MHD_queue_response (mhd_connection, MHD_HTTP_OK, response);
     MHD_destroy_response (response);
     return MHD_YES;
   }
@@ -1472,7 +1470,7 @@ server_access_cb (void *cls, struct MHD_Connection *mhd_connection,
       response = MHD_create_response_from_data (strlen ("Thank you!"),
                                          "Thank you!",
                                          MHD_NO, MHD_NO);
-      res = MHD_queue_response (mhd_connection, MHD_HTTP_OK, response);
+      MHD_queue_response (mhd_connection, MHD_HTTP_OK, response);
       MHD_destroy_response (response);
       return MHD_YES;
     }