aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_server.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-04-27 13:14:57 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-04-27 13:14:57 +0000
commita689f1c66d2663ab1f3e6ec6347707612908d25c (patch)
treea89b351462ebcfef1829aa56005e999ecfc70f1b /src/transport/plugin_transport_http_server.c
parent5ac41046becd09673549fb42f4b387ed847c507d (diff)
downloadgnunet-a689f1c66d2663ab1f3e6ec6347707612908d25c.tar.gz
gnunet-a689f1c66d2663ab1f3e6ec6347707612908d25c.zip
-stat counter for http
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r--src/transport/plugin_transport_http_server.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 22196b218..1ce08435d 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -419,12 +419,12 @@ server_lookup_session (struct Plugin *plugin,
419 419
420 plugin->cur_connections++; 420 plugin->cur_connections++;
421 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 421 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
422 "Server: New inbound connection from %s with tag %u\n", 422 "Server: New %s connection from %s with tag %u\n",
423 method,
423 GNUNET_i2s (&target), tag); 424 GNUNET_i2s (&target), tag);
424 /* find duplicate session */
425 425
426 /* find duplicate session */
426 t = plugin->head; 427 t = plugin->head;
427
428 while (t != NULL) 428 while (t != NULL)
429 { 429 {
430 if ((t->inbound) && 430 if ((t->inbound) &&
@@ -480,6 +480,13 @@ server_lookup_session (struct Plugin *plugin,
480 "Server: Found matching semi-session, merging session for peer `%s'\n", 480 "Server: Found matching semi-session, merging session for peer `%s'\n",
481 GNUNET_i2s (&target)); 481 GNUNET_i2s (&target));
482 482
483 GNUNET_break (0);
484 plugin->inbound_sessions ++;
485 GNUNET_STATISTICS_set (plugin->env->stats,
486 "# HTTP inbound sessions",
487 plugin->inbound_sessions,
488 GNUNET_NO);
489
483 goto found; 490 goto found;
484 } 491 }
485 if ((direction == _RECEIVE) && (t->server_recv != NULL)) 492 if ((direction == _RECEIVE) && (t->server_recv != NULL))
@@ -498,6 +505,14 @@ server_lookup_session (struct Plugin *plugin,
498 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 505 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
499 "Server: Found matching semi-session, merging session for peer `%s'\n", 506 "Server: Found matching semi-session, merging session for peer `%s'\n",
500 GNUNET_i2s (&target)); 507 GNUNET_i2s (&target));
508
509 GNUNET_break (0);
510 plugin->inbound_sessions ++;
511 GNUNET_STATISTICS_set (plugin->env->stats,
512 "# HTTP inbound sessions",
513 plugin->inbound_sessions,
514 GNUNET_NO);
515
501 goto found; 516 goto found;
502 } 517 }
503 518
@@ -741,7 +756,7 @@ server_disconnect_cb (void *cls, struct MHD_Connection *connection,
741 struct Session *s = NULL; 756 struct Session *s = NULL;
742 struct Session *t = NULL; 757 struct Session *t = NULL;
743 struct Plugin *plugin = NULL; 758 struct Plugin *plugin = NULL;
744 759GNUNET_break (0);
745 if (sc == NULL) 760 if (sc == NULL)
746 return; 761 return;
747 762
@@ -829,6 +844,12 @@ server_disconnect_cb (void *cls, struct MHD_Connection *connection,
829 s->msg_tk = NULL; 844 s->msg_tk = NULL;
830 } 845 }
831 846
847 GNUNET_assert (plugin->inbound_sessions > 0);
848 plugin->inbound_sessions --;
849 GNUNET_STATISTICS_set (plugin->env->stats,
850 "# HTTP inbound sessions",
851 plugin->inbound_sessions, GNUNET_NO);
852
832 notify_session_end (s->plugin, &s->target, s); 853 notify_session_end (s->plugin, &s->target, s);
833 } 854 }
834} 855}