fixes
authorChristian Grothoff <christian@grothoff.org>
Fri, 25 Mar 2011 08:18:47 +0000 (08:18 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 25 Mar 2011 08:18:47 +0000 (08:18 +0000)
src/fs/gnunet-service-fs_lc.c
src/fs/gnunet-service-fs_new.c
src/fs/gnunet-service-fs_pr.c

index 2b069d9ca18f6f5abe95410efc96f8c9bacc3154..8727670e8d9fb4e66824323f8453199406cfc8d1 100644 (file)
@@ -232,12 +232,23 @@ client_response_handler (void *cls,
   pm->expiration = GNUNET_TIME_absolute_hton (expiration);
   memcpy (&pm[1], data, data_len);      
   GSF_local_client_transmit_ (lc, &pm->header);
-
+#if DEBUG_FS
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Queued reply to query `%s' for local client\n",
+             GNUNET_h2s (&prd->query),
+             (unsigned int) prd->type);
+#endif
   if (GNUNET_NO == more)               
     {
       GNUNET_CONTAINER_DLL_remove (lc->cr_head,
                                   lc->cr_tail,
                                   cr);
+      GNUNET_SERVER_receive_done (lc->client,
+                                 GNUNET_OK);
+      GNUNET_STATISTICS_update (GSF_stats,
+                               gettext_noop ("# client searches active"),
+                               - 1,
+                               GNUNET_NO);
       GNUNET_free (cr);
     }
 }
@@ -469,6 +480,10 @@ GSF_client_disconnect_handler_ (void *cls,
                                   pos->cr_tail,
                                   cr);
       GSF_pending_request_cancel_ (cr->pr);
+      GNUNET_STATISTICS_update (GSF_stats,
+                               gettext_noop ("# client searches active"),
+                               - 1,
+                               GNUNET_NO);
       GNUNET_free (cr);
     }
   while (NULL != (res = pos->res_head))
index 0f5931a197c876e84426c72056ec87ff1ca78fdf..94a5ff2bf2c7e360f64362a83c9ae343dc91dade 100644 (file)
@@ -339,11 +339,17 @@ start_p2p_processing (void *cls,
   struct GNUNET_SERVER_Client *client = cls;
   struct GSF_PendingRequestData *prd;
 
+  prd = GSF_pending_request_get_data_ (pr);
+#if DEBUG_FS
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Finished database lookup for local request `%s' with result %d\n",
+             GNUNET_h2s (&prd->query),
+             result);
+#endif
   GNUNET_SERVER_receive_done (client,
                              GNUNET_OK);
   if (GNUNET_BLOCK_EVALUATION_OK_LAST == result)
     return; /* we're done, 'pr' was already destroyed... */
-  prd = GSF_pending_request_get_data_ (pr);
   if (0 != (GSF_PRO_LOCAL_ONLY & prd->options) )
     {
       GSF_pending_request_cancel_ (pr);
index d8cd8716ef31e80c1f2c76652985ca0d53c4c845..c3116ba23e6b1c6f48b213babb37a65011017b34 100644 (file)
@@ -1034,10 +1034,21 @@ process_local_reply (void *cls,
     GSF_update_datastore_delay_ (pr->public_data.start_time);
   process_reply (&prq, key, pr);
   if (prq.finished == GNUNET_YES)
-    return;
+    {
+#if DEBUG_FS
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Request processing finished, not asking datastore for more\n");
+#endif
+      return;
+    }
   pr->local_result = prq.eval;
   if (pr->qe == NULL)
-    return; /* done here */
+    {
+#if DEBUG_FS
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Request cancelled, not asking datastore for more\n");
+#endif
+    }
   if (prq.eval == GNUNET_BLOCK_EVALUATION_OK_LAST)
     {
       GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_NO);