changes
authorMatthias Wachs <wachs@net.in.tum.de>
Mon, 27 Aug 2012 11:51:11 +0000 (11:51 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Mon, 27 Aug 2012 11:51:11 +0000 (11:51 +0000)
src/transport/plugin_transport_http_client.c
src/transport/test_transport_api_http_peer1.conf
src/transport/test_transport_api_http_peer2.conf
src/transport/test_transport_api_http_reverse_proxy.conf

index 6f74fdf34189e1a0c077c131948da60ebaf38689..5fbf3592dfd68ff4ae12b57b538fe2a79629931a 100644 (file)
@@ -1140,6 +1140,24 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
 }
 
 
+static int
+client_configure_plugin (struct HTTP_Client_Plugin *plugin)
+{
+  unsigned long long max_connections;
+
+  /* Optional parameters */
+  if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (plugin->env->cfg,
+                      plugin->name,
+                      "MAX_CONNECTIONS", &max_connections))
+    max_connections = 128;
+  plugin->max_connections = max_connections;
+
+  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+                   _("Maximum number of connections is %u\n"),
+                   plugin->max_connections);
+  return GNUNET_OK;
+}
+
 /**
  * Entry point for the plugin.
  */
@@ -1184,6 +1202,12 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls)
   plugin->protocol = "http";
 #endif
 
+  if (GNUNET_SYSERR == client_configure_plugin (plugin))
+  {
+      LIBGNUNET_PLUGIN_TRANSPORT_DONE (api);
+      return NULL;
+  }
+
   /* Start client */
   if (GNUNET_SYSERR == client_start (plugin))
   {
index 26c29699b71962f61b9ca48b265a5baf9738bda8..4af712a4323d9ad8dd7fd2ecb57cb4cc4a6fb124 100644 (file)
@@ -3,8 +3,7 @@
 SERVICEHOME = /tmp/test-transport/api-http-p1/
 DEFAULTCONFIG = test_transport_api_http_peer1.conf
 
-[transport-http]
-PORT = 12080
+[transport-http_client]
 
 [arm]
 PORT = 12085
@@ -26,7 +25,7 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
 [transport]
 #DEBUG = YES
 PORT = 12081
-PLUGINS = http
+PLUGINS = http_client
 #BINARY = .libs/gnunet-service-transport
 UNIXPATH = /tmp/gnunet-p1-service-transport.sock
 #PREFIX = valgrind --leak-check=full
index fa7aa3b297d9bb9c0dfdc08ace28a4c8a3b396cb..0ac73ee2a289e257a29da60194c5a8a3dae62cc8 100644 (file)
@@ -3,7 +3,7 @@
 SERVICEHOME = /tmp/test-transport/api-http-p2/
 DEFAULTCONFIG = test_transport_api_http_peer2.conf
 
-[transport-http]
+[transport-http_server]
 PORT = 12090
 
 [arm]
@@ -26,6 +26,6 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock
 [transport]
 #DEBUG = YES
 PORT = 12091
-PLUGINS = http
+PLUGINS = http_server
 UNIXPATH = /tmp/gnunet-p2-service-transport.sock
 #PREFIX = valgrind --leak-check=full
index 53a7d467c26110e1dc601cbf97f08eaa2c12fd25..c8162df0dad9a1214cdd96f241ebc27bb1e5d555 100644 (file)
@@ -38,7 +38,7 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
 #DEBUG = YES
 PORT = 12081
 #PLUGINS = http_server
-PLUGINS = http_client
+PLUGINS = http_client http_server
 # http_client
 #BINARY = .libs/gnunet-service-transport
 UNIXPATH = /tmp/gnunet-p1-service-transport.sock