aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r--src/transport/plugin_transport_http_server.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 5088f2e77..63c67b81c 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 Copyright (C) 2002-2014 GNUnet e.V. 3 Copyright (C) 2002-2014, 2017 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -29,7 +29,7 @@
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_statistics_service.h" 30#include "gnunet_statistics_service.h"
31#include "gnunet_transport_plugin.h" 31#include "gnunet_transport_plugin.h"
32#include "gnunet_nat_lib.h" 32#include "gnunet_nat_service.h"
33#include "plugin_transport_http_common.h" 33#include "plugin_transport_http_common.h"
34#include <microhttpd.h> 34#include <microhttpd.h>
35#include <regex.h> 35#include <regex.h>
@@ -2473,12 +2473,14 @@ server_remove_address (void *cls,
2473 * @param cls closure, the 'struct LocalAddrList' 2473 * @param cls closure, the 'struct LocalAddrList'
2474 * @param add_remove #GNUNET_YES to mean the new public IP address, #GNUNET_NO to mean 2474 * @param add_remove #GNUNET_YES to mean the new public IP address, #GNUNET_NO to mean
2475 * the previous (now invalid) one 2475 * the previous (now invalid) one
2476 * @param ac address class the address belongs to
2476 * @param addr either the previous or the new public IP address 2477 * @param addr either the previous or the new public IP address
2477 * @param addrlen actual lenght of the address 2478 * @param addrlen actual lenght of the address
2478 */ 2479 */
2479static void 2480static void
2480server_nat_port_map_callback (void *cls, 2481server_nat_port_map_callback (void *cls,
2481 int add_remove, 2482 int add_remove,
2483 enum GNUNET_NAT_AddressClass ac,
2482 const struct sockaddr *addr, 2484 const struct sockaddr *addr,
2483 socklen_t addrlen) 2485 socklen_t addrlen)
2484{ 2486{
@@ -2498,7 +2500,8 @@ server_nat_port_map_callback (void *cls,
2498 2500
2499 if ((NULL != plugin->server_addr_v4) && 2501 if ((NULL != plugin->server_addr_v4) &&
2500 (0 != memcmp (&plugin->server_addr_v4->sin_addr, 2502 (0 != memcmp (&plugin->server_addr_v4->sin_addr,
2501 &s4->sin_addr, sizeof (struct in_addr)))) 2503 &s4->sin_addr,
2504 sizeof (struct in_addr))))
2502 { 2505 {
2503 LOG (GNUNET_ERROR_TYPE_DEBUG, 2506 LOG (GNUNET_ERROR_TYPE_DEBUG,
2504 "Skipping address `%s' (not bindto address)\n", 2507 "Skipping address `%s' (not bindto address)\n",
@@ -2754,14 +2757,16 @@ server_start_report_addresses (struct HTTP_Server_Plugin *plugin)
2754 return; 2757 return;
2755 } 2758 }
2756 2759
2757 plugin->nat = 2760 plugin->nat
2758 GNUNET_NAT_register (plugin->env->cfg, 2761 = GNUNET_NAT_register (plugin->env->cfg,
2759 GNUNET_YES, 2762 "transport-http_server",
2760 plugin->port, 2763 IPPROTO_TCP,
2761 (unsigned int) res, 2764 (unsigned int) res,
2762 (const struct sockaddr **) addrs, addrlens, 2765 (const struct sockaddr **) addrs,
2763 &server_nat_port_map_callback, NULL, 2766 addrlens,
2764 plugin, NULL); 2767 &server_nat_port_map_callback,
2768 NULL,
2769 plugin);
2765 while (res > 0) 2770 while (res > 0)
2766 { 2771 {
2767 res--; 2772 res--;