gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r6106 - GNUnet/src/transports


From: gnunet
Subject: [GNUnet-SVN] r6106 - GNUnet/src/transports
Date: Mon, 21 Jan 2008 11:20:58 -0700 (MST)

Author: grothoff
Date: 2008-01-21 11:20:58 -0700 (Mon, 21 Jan 2008)
New Revision: 6106

Modified:
   GNUnet/src/transports/http.c
Log:
more stats, lower inbound connection limit

Modified: GNUnet/src/transports/http.c
===================================================================
--- GNUnet/src/transports/http.c        2008-01-20 12:26:01 UTC (rev 6105)
+++ GNUnet/src/transports/http.c        2008-01-21 18:20:58 UTC (rev 6106)
@@ -396,6 +396,20 @@
 
 static int stat_bytesDropped;
 
+static int stat_get_issued;
+
+static int stat_get_received;
+
+static int stat_put_issued;
+
+static int stat_put_received;
+
+/**
+ * How many requests do we have currently pending
+ * (with libcurl)?
+ */
+static unsigned int http_requests_pending;
+
 static int signal_pipe[2];
 
 static char *proxy;
@@ -593,6 +607,7 @@
 #if DO_GET
       STEP ();
       curl_multi_remove_handle (curl_multi, httpsession->cs.client.get);
+      http_requests_pending--;
       STEP ();
       signal_select ();
       STEP ();
@@ -608,6 +623,7 @@
           next = pos->next;
           STEP ();
           curl_multi_remove_handle (curl_multi, pos->curl_put);
+         http_requests_pending--;
           STEP ();
           signal_select ();
           curl_easy_cleanup (pos->curl_put);
@@ -1026,6 +1042,13 @@
   httpSession = *httpSessionCache;
   if (httpSession == NULL)
     {
+      /* new http connection */
+      if (stats != NULL) {
+       if (0 == strcasecmp (MHD_HTTP_METHOD_PUT, method)) 
+         stats->change(stat_put_received, 1);
+       else 
+         stats->change(stat_get_received, 1);
+      }  
       GNUNET_mutex_lock (httplock);
       for (i = 0; i < tsessionCount; i++)
         {
@@ -1365,6 +1388,7 @@
       STEP ();
       GNUNET_mutex_lock (curllock);
       curl_multi_remove_handle (curl_multi, curl_get);
+      http_requests_pending--;
       signal_select ();
       STEP ();
       curl_easy_cleanup (curl_get);
@@ -1405,7 +1429,10 @@
   STEP ();
   GNUNET_mutex_lock (curllock);
   mret = curl_multi_add_handle (curl_multi, curl_get);
+  http_requests_pending++;
   GNUNET_mutex_unlock (curllock);
+  if (stats != NULL)
+    stats->change(stat_get_issued, 1);
   STEP ();
   if (mret != CURLM_OK)
     {
@@ -1580,7 +1607,10 @@
   STEP ();
   GNUNET_mutex_lock (curllock);
   mret = curl_multi_add_handle (curl_multi, curl_put);
+  http_requests_pending++;
   GNUNET_mutex_unlock (curllock);
+  if (stats != NULL)
+    stats->change(stat_put_issued, 1);
   STEP ();
   if (mret != CURLM_OK)
     {
@@ -1879,6 +1909,7 @@
                   STEP ();
                   GNUNET_mutex_lock (curllock);
                   curl_multi_remove_handle (curl_multi, pos->curl_put);
+                 http_requests_pending--;
                   GNUNET_mutex_unlock (curllock);
                   STEP ();
                   signal_select ();
@@ -2122,7 +2153,7 @@
                                      MHD_OPTION_CONNECTION_MEMORY_LIMIT,
                                      (unsigned int) 1024 * 128,
                                      MHD_OPTION_CONNECTION_LIMIT,
-                                     (unsigned int) 128,
+                                     (unsigned int) 64,
                                      MHD_OPTION_NOTIFY_COMPLETED,
                                      &requestCompletedCallback, NULL,
                                      MHD_OPTION_END);
@@ -2301,6 +2332,14 @@
       stat_bytesSent = stats->create (gettext_noop ("# bytes sent via HTTP"));
       stat_bytesDropped
         = stats->create (gettext_noop ("# bytes dropped by HTTP (outgoing)"));
+      stat_get_issued
+        = stats->create (gettext_noop ("# HTTP GET issued"));
+      stat_get_received
+        = stats->create (gettext_noop ("# HTTP GET received"));
+      stat_put_issued
+        = stats->create (gettext_noop ("# HTTP PUT issued"));
+      stat_put_received
+        = stats->create (gettext_noop ("# HTTP PUT received"));
     }
   GNUNET_GC_get_configuration_value_string (coreAPI->cfg,
                                             "GNUNETD", "HTTP-PROXY", "",





reply via email to

[Prev in Thread] Current Thread [Next in Thread]