aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_client.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-09-15 15:54:05 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-09-15 15:54:05 +0000
commit4878053408a3681dca18b6a264d2b6ec719e79b0 (patch)
treef95c77ced25342bc93227873a0d2bc4a86e6345a /src/transport/plugin_transport_http_client.c
parent5743ad799f624901abbbf35748d8aeca9edbe66b (diff)
downloadgnunet-4878053408a3681dca18b6a264d2b6ec719e79b0.tar.gz
gnunet-4878053408a3681dca18b6a264d2b6ec719e79b0.zip
server side connection accepting and merging
Diffstat (limited to 'src/transport/plugin_transport_http_client.c')
-rw-r--r--src/transport/plugin_transport_http_client.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index ea8a55614..ca582332a 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -228,6 +228,7 @@ client_disconnect (struct Session *s)
228 GNUNET_break (0); 228 GNUNET_break (0);
229 } 229 }
230 curl_easy_cleanup (s->client_get); 230 curl_easy_cleanup (s->client_get);
231 plugin->cur_connections += 2;
231 232
232 /* Re-schedule since handles have changed */ 233 /* Re-schedule since handles have changed */
233 if (plugin->client_perform_task!= GNUNET_SCHEDULER_NO_TASK) 234 if (plugin->client_perform_task!= GNUNET_SCHEDULER_NO_TASK)
@@ -257,9 +258,14 @@ client_connect (struct Session *s)
257 258
258 s->inbound = GNUNET_NO; 259 s->inbound = GNUNET_NO;
259 260
261 s->plugin->last_tag++;
260 /* create url */ 262 /* create url */
261 GNUNET_asprintf (&url, "%s", http_plugin_address_to_string (s->plugin, s->addr, s->addrlen)); 263 GNUNET_asprintf (&url, "%s%s;%u", http_plugin_address_to_string (s->plugin, s->addr, s->addrlen), GNUNET_h2s_full (&s->plugin->env->my_identity->hashPubKey),s->plugin->last_tag);
262 264#if 0
265 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, s->plugin->name,
266 "URL `%s'\n",
267 url);
268#endif
263 /* create get connection */ 269 /* create get connection */
264 s->client_get = curl_easy_init (); 270 s->client_get = curl_easy_init ();
265#if VERBOSE_CLIENT 271#if VERBOSE_CLIENT
@@ -342,6 +348,7 @@ client_connect (struct Session *s)
342 } 348 }
343 349
344 /* Perform connect */ 350 /* Perform connect */
351 s->plugin->cur_connections += 2;
345 s->plugin->client_perform_task = GNUNET_SCHEDULER_add_now (client_run, s->plugin); 352 s->plugin->client_perform_task = GNUNET_SCHEDULER_add_now (client_run, s->plugin);
346 353
347 return res; 354 return res;