diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-08-27 11:51:11 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-08-27 11:51:11 +0000 |
commit | 1d18c4dbc82dfa442933148a171d37546ec41332 (patch) | |
tree | 3bcf532aecc00bf68379c9d91c2ada24a91992ca /src | |
parent | 10e28c9c40cc8c4b5485af426b723f63a14aef99 (diff) | |
download | gnunet-1d18c4dbc82dfa442933148a171d37546ec41332.tar.gz gnunet-1d18c4dbc82dfa442933148a171d37546ec41332.zip |
changes
Diffstat (limited to 'src')
4 files changed, 29 insertions, 6 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index 6f74fdf34..5fbf3592d 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c | |||
@@ -1140,6 +1140,24 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) | |||
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | 1142 | ||
1143 | static int | ||
1144 | client_configure_plugin (struct HTTP_Client_Plugin *plugin) | ||
1145 | { | ||
1146 | unsigned long long max_connections; | ||
1147 | |||
1148 | /* Optional parameters */ | ||
1149 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (plugin->env->cfg, | ||
1150 | plugin->name, | ||
1151 | "MAX_CONNECTIONS", &max_connections)) | ||
1152 | max_connections = 128; | ||
1153 | plugin->max_connections = max_connections; | ||
1154 | |||
1155 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | ||
1156 | _("Maximum number of connections is %u\n"), | ||
1157 | plugin->max_connections); | ||
1158 | return GNUNET_OK; | ||
1159 | } | ||
1160 | |||
1143 | /** | 1161 | /** |
1144 | * Entry point for the plugin. | 1162 | * Entry point for the plugin. |
1145 | */ | 1163 | */ |
@@ -1184,6 +1202,12 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
1184 | plugin->protocol = "http"; | 1202 | plugin->protocol = "http"; |
1185 | #endif | 1203 | #endif |
1186 | 1204 | ||
1205 | if (GNUNET_SYSERR == client_configure_plugin (plugin)) | ||
1206 | { | ||
1207 | LIBGNUNET_PLUGIN_TRANSPORT_DONE (api); | ||
1208 | return NULL; | ||
1209 | } | ||
1210 | |||
1187 | /* Start client */ | 1211 | /* Start client */ |
1188 | if (GNUNET_SYSERR == client_start (plugin)) | 1212 | if (GNUNET_SYSERR == client_start (plugin)) |
1189 | { | 1213 | { |
diff --git a/src/transport/test_transport_api_http_peer1.conf b/src/transport/test_transport_api_http_peer1.conf index 26c29699b..4af712a43 100644 --- a/src/transport/test_transport_api_http_peer1.conf +++ b/src/transport/test_transport_api_http_peer1.conf | |||
@@ -3,8 +3,7 @@ | |||
3 | SERVICEHOME = /tmp/test-transport/api-http-p1/ | 3 | SERVICEHOME = /tmp/test-transport/api-http-p1/ |
4 | DEFAULTCONFIG = test_transport_api_http_peer1.conf | 4 | DEFAULTCONFIG = test_transport_api_http_peer1.conf |
5 | 5 | ||
6 | [transport-http] | 6 | [transport-http_client] |
7 | PORT = 12080 | ||
8 | 7 | ||
9 | [arm] | 8 | [arm] |
10 | PORT = 12085 | 9 | PORT = 12085 |
@@ -26,7 +25,7 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock | |||
26 | [transport] | 25 | [transport] |
27 | #DEBUG = YES | 26 | #DEBUG = YES |
28 | PORT = 12081 | 27 | PORT = 12081 |
29 | PLUGINS = http | 28 | PLUGINS = http_client |
30 | #BINARY = .libs/gnunet-service-transport | 29 | #BINARY = .libs/gnunet-service-transport |
31 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock | 30 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock |
32 | #PREFIX = valgrind --leak-check=full | 31 | #PREFIX = valgrind --leak-check=full |
diff --git a/src/transport/test_transport_api_http_peer2.conf b/src/transport/test_transport_api_http_peer2.conf index fa7aa3b29..0ac73ee2a 100644 --- a/src/transport/test_transport_api_http_peer2.conf +++ b/src/transport/test_transport_api_http_peer2.conf | |||
@@ -3,7 +3,7 @@ | |||
3 | SERVICEHOME = /tmp/test-transport/api-http-p2/ | 3 | SERVICEHOME = /tmp/test-transport/api-http-p2/ |
4 | DEFAULTCONFIG = test_transport_api_http_peer2.conf | 4 | DEFAULTCONFIG = test_transport_api_http_peer2.conf |
5 | 5 | ||
6 | [transport-http] | 6 | [transport-http_server] |
7 | PORT = 12090 | 7 | PORT = 12090 |
8 | 8 | ||
9 | [arm] | 9 | [arm] |
@@ -26,6 +26,6 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock | |||
26 | [transport] | 26 | [transport] |
27 | #DEBUG = YES | 27 | #DEBUG = YES |
28 | PORT = 12091 | 28 | PORT = 12091 |
29 | PLUGINS = http | 29 | PLUGINS = http_server |
30 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock | 30 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock |
31 | #PREFIX = valgrind --leak-check=full | 31 | #PREFIX = valgrind --leak-check=full |
diff --git a/src/transport/test_transport_api_http_reverse_proxy.conf b/src/transport/test_transport_api_http_reverse_proxy.conf index 53a7d467c..c8162df0d 100644 --- a/src/transport/test_transport_api_http_reverse_proxy.conf +++ b/src/transport/test_transport_api_http_reverse_proxy.conf | |||
@@ -38,7 +38,7 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock | |||
38 | #DEBUG = YES | 38 | #DEBUG = YES |
39 | PORT = 12081 | 39 | PORT = 12081 |
40 | #PLUGINS = http_server | 40 | #PLUGINS = http_server |
41 | PLUGINS = http_client | 41 | PLUGINS = http_client http_server |
42 | # http_client | 42 | # http_client |
43 | #BINARY = .libs/gnunet-service-transport | 43 | #BINARY = .libs/gnunet-service-transport |
44 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock | 44 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock |