aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_client.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-07-04 10:50:33 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-07-04 10:50:33 +0000
commitabab7894ded8edea6d24784e877e666755df6a5d (patch)
tree98bfa825e8b328a0b382bb91735123f8c527a403 /src/transport/plugin_transport_http_client.c
parent9e653501c9cf90d20408ab350cdd04f9c2ac3399 (diff)
downloadgnunet-abab7894ded8edea6d24784e877e666755df6a5d.tar.gz
gnunet-abab7894ded8edea6d24784e877e666755df6a5d.zip
fix statistics for reuqests
Diffstat (limited to 'src/transport/plugin_transport_http_client.c')
-rw-r--r--src/transport/plugin_transport_http_client.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index c4c8b1933..38b0775f3 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -471,6 +471,8 @@ client_delete_session (struct Session *s)
471 s->put.easyhandle); 471 s->put.easyhandle);
472 GNUNET_break (CURLM_OK == mret); 472 GNUNET_break (CURLM_OK == mret);
473 curl_easy_cleanup (s->put.easyhandle); 473 curl_easy_cleanup (s->put.easyhandle);
474 GNUNET_assert (plugin->cur_requests > 0);
475 plugin->cur_requests--;
474 s->put.easyhandle = NULL; 476 s->put.easyhandle = NULL;
475 } 477 }
476 if (NULL != s->get.easyhandle) 478 if (NULL != s->get.easyhandle)
@@ -488,6 +490,7 @@ client_delete_session (struct Session *s)
488 plugin->cur_requests--; 490 plugin->cur_requests--;
489 s->get.easyhandle = NULL; 491 s->get.easyhandle = NULL;
490 } 492 }
493
491 GNUNET_STATISTICS_set (plugin->env->stats, 494 GNUNET_STATISTICS_set (plugin->env->stats,
492 HTTP_STAT_STR_CONNECTIONS, 495 HTTP_STAT_STR_CONNECTIONS,
493 plugin->cur_requests, 496 plugin->cur_requests,
@@ -1318,7 +1321,6 @@ client_run (void *cls,
1318 GNUNET_break (CURLE_OK == curl_easy_getinfo (easy_h, 1321 GNUNET_break (CURLE_OK == curl_easy_getinfo (easy_h,
1319 CURLINFO_RESPONSE_CODE, &http_statuscode)); 1322 CURLINFO_RESPONSE_CODE, &http_statuscode));
1320 1323
1321
1322 if (easy_h == s->put.easyhandle) 1324 if (easy_h == s->put.easyhandle)
1323 put_request = GNUNET_YES; 1325 put_request = GNUNET_YES;
1324 else 1326 else
@@ -1414,6 +1416,11 @@ client_run (void *cls,
1414 } 1416 }
1415 else 1417 else
1416 GNUNET_break (0); /* Must not happen */ 1418 GNUNET_break (0); /* Must not happen */
1419
1420 GNUNET_STATISTICS_set (plugin->env->stats,
1421 HTTP_STAT_STR_CONNECTIONS,
1422 plugin->cur_requests,
1423 GNUNET_NO);
1417 } 1424 }
1418 } 1425 }
1419 while (mret == CURLM_CALL_MULTI_PERFORM); 1426 while (mret == CURLM_CALL_MULTI_PERFORM);