diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-04-27 13:14:57 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-04-27 13:14:57 +0000 |
commit | a689f1c66d2663ab1f3e6ec6347707612908d25c (patch) | |
tree | a89b351462ebcfef1829aa56005e999ecfc70f1b /src/transport/plugin_transport_http_client.c | |
parent | 5ac41046becd09673549fb42f4b387ed847c507d (diff) | |
download | gnunet-a689f1c66d2663ab1f3e6ec6347707612908d25c.tar.gz gnunet-a689f1c66d2663ab1f3e6ec6347707612908d25c.zip |
-stat counter for http
Diffstat (limited to 'src/transport/plugin_transport_http_client.c')
-rw-r--r-- | src/transport/plugin_transport_http_client.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index eefc98b2e..c64a594cd 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c | |||
@@ -264,11 +264,9 @@ client_disconnect (struct Session *s) | |||
264 | 264 | ||
265 | if (s->client_put != NULL) | 265 | if (s->client_put != NULL) |
266 | { | 266 | { |
267 | #if DEBUG_HTTP | ||
268 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 267 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
269 | "Client: %X Deleting outbound PUT session to peer `%s'\n", | 268 | "Client: %X Deleting outbound PUT session to peer `%s'\n", |
270 | s->client_put, GNUNET_i2s (&s->target)); | 269 | s->client_put, GNUNET_i2s (&s->target)); |
271 | #endif | ||
272 | 270 | ||
273 | mret = curl_multi_remove_handle (plugin->client_mh, s->client_put); | 271 | mret = curl_multi_remove_handle (plugin->client_mh, s->client_put); |
274 | if (mret != CURLM_OK) | 272 | if (mret != CURLM_OK) |
@@ -290,11 +288,9 @@ client_disconnect (struct Session *s) | |||
290 | 288 | ||
291 | if (s->client_get != NULL) | 289 | if (s->client_get != NULL) |
292 | { | 290 | { |
293 | #if DEBUG_HTTP | ||
294 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 291 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
295 | "Client: %X Deleting outbound GET session to peer `%s'\n", | 292 | "Client: %X Deleting outbound GET session to peer `%s'\n", |
296 | s->client_get, GNUNET_i2s (&s->target)); | 293 | s->client_get, GNUNET_i2s (&s->target)); |
297 | #endif | ||
298 | 294 | ||
299 | mret = curl_multi_remove_handle (plugin->client_mh, s->client_get); | 295 | mret = curl_multi_remove_handle (plugin->client_mh, s->client_get); |
300 | if (mret != CURLM_OK) | 296 | if (mret != CURLM_OK) |
@@ -319,6 +315,14 @@ client_disconnect (struct Session *s) | |||
319 | } | 315 | } |
320 | 316 | ||
321 | plugin->cur_connections -= 2; | 317 | plugin->cur_connections -= 2; |
318 | |||
319 | GNUNET_assert (plugin->outbound_sessions > 0); | ||
320 | plugin->outbound_sessions --; | ||
321 | GNUNET_STATISTICS_set (plugin->env->stats, | ||
322 | "# HTTP outbound sessions", | ||
323 | plugin->outbound_sessions, | ||
324 | GNUNET_NO); | ||
325 | |||
322 | /* Re-schedule since handles have changed */ | 326 | /* Re-schedule since handles have changed */ |
323 | if (plugin->client_perform_task != GNUNET_SCHEDULER_NO_TASK) | 327 | if (plugin->client_perform_task != GNUNET_SCHEDULER_NO_TASK) |
324 | { | 328 | { |
@@ -634,6 +638,12 @@ client_connect (struct Session *s) | |||
634 | /* Perform connect */ | 638 | /* Perform connect */ |
635 | plugin->cur_connections += 2; | 639 | plugin->cur_connections += 2; |
636 | 640 | ||
641 | plugin->outbound_sessions ++; | ||
642 | GNUNET_STATISTICS_set (plugin->env->stats, | ||
643 | "# HTTP outbound sessions", | ||
644 | plugin->outbound_sessions, | ||
645 | GNUNET_NO); | ||
646 | |||
637 | /* Re-schedule since handles have changed */ | 647 | /* Re-schedule since handles have changed */ |
638 | if (plugin->client_perform_task != GNUNET_SCHEDULER_NO_TASK) | 648 | if (plugin->client_perform_task != GNUNET_SCHEDULER_NO_TASK) |
639 | { | 649 | { |