[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r12247 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r12247 - gnunet/src/transport |
Date: |
Fri, 16 Jul 2010 17:31:37 +0200 |
Author: wachs
Date: 2010-07-16 17:31:37 +0200 (Fri, 16 Jul 2010)
New Revision: 12247
Modified:
gnunet/src/transport/Makefile.am
gnunet/src/transport/plugin_transport_http.c
gnunet/src/transport/test_plugin_transport_data_http.conf
gnunet/src/transport/test_transport_api_http_peer1.conf
gnunet/src/transport/test_transport_api_http_peer2.conf
gnunet/src/transport/test_transport_api_rel_http_peer1.conf
gnunet/src/transport/test_transport_api_rel_http_peer2.conf
gnunet/src/transport/test_transport_api_reliability.c
Log:
Modified: gnunet/src/transport/Makefile.am
===================================================================
--- gnunet/src/transport/Makefile.am 2010-07-16 14:18:29 UTC (rev 12246)
+++ gnunet/src/transport/Makefile.am 2010-07-16 15:31:37 UTC (rev 12247)
@@ -146,6 +146,7 @@
test_transport_api_udp_nat \
test_plugin_transport_http \
test_transport_api_http \
+ test_transport_api_reliability_http \
test_transport_api_reliability_tcp \
test_transport_api_reliability_tcp_nat
@@ -224,4 +225,8 @@
test_transport_api_tcp_nat_peer1.conf \
test_transport_api_tcp_nat_peer2.conf \
test_plugin_transport_data.conf \
+ test_transport_api_http_peer1.conf \
+ test_transport_api_http_peer2.conf \
+ test_transport_api_rel_http_peer1.conf \
+ test_transport_api_rel_http_peer2.conf \
test_plugin_transport_data_http.conf
Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c 2010-07-16 14:18:29 UTC
(rev 12246)
+++ gnunet/src/transport/plugin_transport_http.c 2010-07-16 15:31:37 UTC
(rev 12247)
@@ -40,7 +40,7 @@
#include "microhttpd.h"
#include <curl/curl.h>
-#define DEBUG_HTTP GNUNET_YES
+#define DEBUG_HTTP GNUNET_NO
#define DEBUG_CURL GNUNET_NO
#define DEBUG_CONNECTIONS GNUNET_NO
#define DEBUG_SESSION_SELECTION GNUNET_NO
@@ -360,6 +360,7 @@
struct sockaddr_in6 * bind6_address;
char * bind_hostname;
int use_ipv6;
+ int use_ipv4;
};
@@ -545,10 +546,9 @@
GNUNET_assert(cls !=NULL);
af = addr->sa_family;
- if ((af == AF_INET) && (plugin->bind6_address == NULL))
+ if ((af == AF_INET) && (plugin->use_ipv4 == GNUNET_YES) &&
(plugin->bind6_address == NULL))
{
struct in_addr bnd_cmp = ((struct sockaddr_in *) addr)->sin_addr;
-
t4 = GNUNET_malloc(sizeof(struct IPv4HttpAddress));
/* Not skipping loopback addresses
if (INADDR_LOOPBACK == ntohl(((struct sockaddr_in *)
addr)->sin_addr.s_addr))
@@ -572,7 +572,7 @@
}
GNUNET_free (t4);
}
- else if ((af == AF_INET6) && (plugin->use_ipv6==GNUNET_YES) &&
(plugin->bind4_address == NULL))
+ else if ((af == AF_INET6) && (plugin->use_ipv6 == GNUNET_YES) &&
(plugin->bind4_address == NULL))
{
struct in6_addr bnd_cmp6 = ((struct sockaddr_in6 *) addr)->sin6_addr;
t6 = GNUNET_malloc(sizeof(struct IPv6HttpAddress));
@@ -602,7 +602,6 @@
}
GNUNET_free (t6);
}
- //return GNUNET_NO;
return GNUNET_OK;
}
@@ -2258,6 +2257,7 @@
plugin->peers = NULL;
plugin->bind4_address = NULL;
plugin->use_ipv6 = GNUNET_YES;
+ plugin->use_ipv4 = GNUNET_YES;
api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions));
api->cls = plugin;
@@ -2277,11 +2277,16 @@
plugin->use_ipv6 = GNUNET_CONFIGURATION_get_value_yesno (env->cfg,
"transport-http",
"USE_IPv6");
-
-
-
}
/* Reading port number from config file */
+ if (GNUNET_CONFIGURATION_have_value (env->cfg,
+
"transport-http", "USE_IPv4"))
+ {
+ plugin->use_ipv4 = GNUNET_CONFIGURATION_get_value_yesno (env->cfg,
+
"transport-http",
+
"USE_IPv4");
+ }
+ /* Reading port number from config file */
if ((GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_number (env->cfg,
"transport-http",
@@ -2298,8 +2303,8 @@
}
/* Reading ipv4 addresse to bind to from config file */
- if (GNUNET_CONFIGURATION_have_value (env->cfg,
-
"transport-http", "BINDTO4"))
+ if ((plugin->use_ipv4==GNUNET_YES) && (GNUNET_CONFIGURATION_have_value
(env->cfg,
+
"transport-http", "BINDTO4")))
{
GNUNET_break (GNUNET_OK ==
GNUNET_CONFIGURATION_get_value_string
(env->cfg,
@@ -2310,8 +2315,6 @@
plugin->bind4_address->sin_family = AF_INET;
plugin->bind4_address->sin_port = htons (port);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"v4 Hostname
`%s'!\n",plugin->bind_hostname);
-
if (inet_pton(AF_INET,plugin->bind_hostname,
&plugin->bind4_address->sin_addr)<=0)
{
GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR,
@@ -2326,8 +2329,8 @@
}
/* Reading ipv4 addresse to bind to from config file */
- if (GNUNET_CONFIGURATION_have_value (env->cfg,
-
"transport-http", "BINDTO6"))
+ if ((plugin->use_ipv6==GNUNET_YES) && (GNUNET_CONFIGURATION_have_value
(env->cfg,
+
"transport-http", "BINDTO6")))
{
GNUNET_break (GNUNET_OK ==
GNUNET_CONFIGURATION_get_value_string
(env->cfg,
@@ -2339,8 +2342,6 @@
plugin->bind6_address->sin6_family = AF_INET6;
plugin->bind6_address->sin6_port = htons (port);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"v6 Hostname
`%s'!\n",plugin->bind_hostname);
-
if (inet_pton(AF_INET6,plugin->bind_hostname,
&plugin->bind6_address->sin6_addr)<=0)
{
GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR,
@@ -2351,13 +2352,7 @@
GNUNET_free(plugin->bind_hostname);
plugin->bind_hostname = NULL;
plugin->bind6_address = NULL;
-
}
-
- char * tmp = GNUNET_malloc(50);
- inet_ntop(AF_INET6,&plugin->bind6_address->sin6_addr,tmp,50);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"v6 Hostname reverse
`%s'!\n",tmp);
- GNUNET_free(tmp);
}
GNUNET_assert ((port > 0) && (port <= 65535));
@@ -2383,7 +2378,7 @@
MHD_OPTION_NOTIFY_COMPLETED,
&mhd_termination_cb, NULL,
MHD_OPTION_END);
}
- if ((plugin->http_server_daemon_v4 == NULL) && (port != 0))
+ if ((plugin->http_server_daemon_v4 == NULL) && (plugin->use_ipv4 ==
GNUNET_YES) && (port != 0))
{
plugin->http_server_daemon_v4 = MHD_start_daemon (
#if DEBUG_CONNECTIONS
Modified: gnunet/src/transport/test_plugin_transport_data_http.conf
===================================================================
--- gnunet/src/transport/test_plugin_transport_data_http.conf 2010-07-16
14:18:29 UTC (rev 12246)
+++ gnunet/src/transport/test_plugin_transport_data_http.conf 2010-07-16
15:31:37 UTC (rev 12247)
@@ -8,8 +8,9 @@
[transport-http]
PORT = 12389
DEBUG = NO
+#USE_IPv4 = NO
+#USE_IPv6 = NO
USE_IPv6 = YES
-#USE_IPv6 = NO
#BINDTO4 = 127.0.0.1
#BINDTO6 = ::1
Modified: gnunet/src/transport/test_transport_api_http_peer1.conf
===================================================================
--- gnunet/src/transport/test_transport_api_http_peer1.conf 2010-07-16
14:18:29 UTC (rev 12246)
+++ gnunet/src/transport/test_transport_api_http_peer1.conf 2010-07-16
15:31:37 UTC (rev 12247)
@@ -1,8 +1,9 @@
[transport-http]
PORT = 12389
DEBUG = NO
-USE_IPv6 = NO
-BINDTO4 = 127.0.0.1
+USE_IPv6 = YES
+USE_IPv4 = YES
+#BINDTO4 = 127.0.0.1
#BINDTO6 = ::1
@@ -37,7 +38,7 @@
[transport]
PLUGINS = http
#PLUGINS = tcp http
-DEBUG = NO
+DEBUG = YES
ACCEPT_FROM6 = ::1;
ACCEPT_FROM = 127.0.0.1;
NEIGHBOUR_LIMIT = 50
@@ -106,6 +107,5 @@
HOSTKEY = $SERVICEHOME/.hostkey
[PATHS]
-DEFAULTCONFIG = test_transport_api_http_peer1.conf
SERVICEHOME = /tmp/test-gnunetd-transport-peer-1/
Modified: gnunet/src/transport/test_transport_api_http_peer2.conf
===================================================================
--- gnunet/src/transport/test_transport_api_http_peer2.conf 2010-07-16
14:18:29 UTC (rev 12246)
+++ gnunet/src/transport/test_transport_api_http_peer2.conf 2010-07-16
15:31:37 UTC (rev 12247)
@@ -1,8 +1,9 @@
[transport-http]
PORT = 22368
DEBUG = NO
-USE_IPv6 = NO
-BINDTO4 = 127.0.0.1
+USE_IPv6 = YES
+USE_IPv4 = YES
+#BINDTO4 = 127.0.0.1
#BINDTO6 = ::1
[fs]
@@ -36,7 +37,7 @@
[transport]
PLUGINS = http
#PLUGINS = tcp http
-DEBUG = NO
+DEBUG = YES
ACCEPT_FROM6 = ::1;
ACCEPT_FROM = 127.0.0.1;
NEIGHBOUR_LIMIT = 50
@@ -110,6 +111,5 @@
HOSTKEY = $SERVICEHOME/.hostkey
[PATHS]
-DEFAULTCONFIG = test_transport_api_http_peer2.conf
SERVICEHOME = /tmp/test-gnunetd-transport-peer-2/
Modified: gnunet/src/transport/test_transport_api_rel_http_peer1.conf
===================================================================
--- gnunet/src/transport/test_transport_api_rel_http_peer1.conf 2010-07-16
14:18:29 UTC (rev 12246)
+++ gnunet/src/transport/test_transport_api_rel_http_peer1.conf 2010-07-16
15:31:37 UTC (rev 12247)
@@ -1,11 +1,11 @@
[transport-http]
PORT = 12389
DEBUG = NO
+USE_IPv4 = YES
USE_IPv6 = NO
BINDTO4 = 127.0.0.1
#BINDTO6 = ::1
-
[fs]
AUTOSTART = NO
@@ -37,7 +37,7 @@
[transport]
PLUGINS = http
#PLUGINS = tcp http
-DEBUG = NO
+DEBUG = YES
ACCEPT_FROM6 = ::1;
ACCEPT_FROM = 127.0.0.1;
NEIGHBOUR_LIMIT = 50
@@ -106,6 +106,5 @@
HOSTKEY = $SERVICEHOME/.hostkey
[PATHS]
-DEFAULTCONFIG = test_transport_api_http_peer1.conf
SERVICEHOME = /tmp/test-gnunetd-transport-peer-1/
Modified: gnunet/src/transport/test_transport_api_rel_http_peer2.conf
===================================================================
--- gnunet/src/transport/test_transport_api_rel_http_peer2.conf 2010-07-16
14:18:29 UTC (rev 12246)
+++ gnunet/src/transport/test_transport_api_rel_http_peer2.conf 2010-07-16
15:31:37 UTC (rev 12247)
@@ -1,6 +1,7 @@
[transport-http]
-PORT = 22368
+PORT = 22389
DEBUG = NO
+USE_IPv4 = YES
USE_IPv6 = NO
BINDTO4 = 127.0.0.1
#BINDTO6 = ::1
@@ -36,7 +37,7 @@
[transport]
PLUGINS = http
#PLUGINS = tcp http
-DEBUG = NO
+DEBUG = YES
ACCEPT_FROM6 = ::1;
ACCEPT_FROM = 127.0.0.1;
NEIGHBOUR_LIMIT = 50
@@ -110,6 +111,5 @@
HOSTKEY = $SERVICEHOME/.hostkey
[PATHS]
-DEFAULTCONFIG = test_transport_api_http_peer2.conf
SERVICEHOME = /tmp/test-gnunetd-transport-peer-2/
Modified: gnunet/src/transport/test_transport_api_reliability.c
===================================================================
--- gnunet/src/transport/test_transport_api_reliability.c 2010-07-16
14:18:29 UTC (rev 12246)
+++ gnunet/src/transport/test_transport_api_reliability.c 2010-07-16
15:31:37 UTC (rev 12247)
@@ -446,8 +446,8 @@
}
else if (is_http)
{
- setup_peer (&p1, "test_transport_api_http_peer1.conf");
- setup_peer (&p2, "test_transport_api_http_peer2.conf");
+ setup_peer (&p1, "test_transport_api_rel_http_peer1.conf");
+ setup_peer (&p2, "test_transport_api_rel_http_peer2.conf");
}
else if (is_udp)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r12247 - gnunet/src/transport,
gnunet <=