gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r14716 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r14716 - gnunet/src/fs
Date: Fri, 25 Mar 2011 09:49:47 +0100

Author: grothoff
Date: 2011-03-25 09:49:47 +0100 (Fri, 25 Mar 2011)
New Revision: 14716

Modified:
   gnunet/src/fs/gnunet-service-fs.c
   gnunet/src/fs/gnunet-service-fs_cp.c
   gnunet/src/fs/gnunet-service-fs_lc.c
   gnunet/src/fs/gnunet-service-fs_pr.c
   gnunet/src/fs/gnunet-service-fs_pr.h
   gnunet/src/fs/gnunet-service-fs_push.c
   gnunet/src/fs/gnunet-service-fs_put.c
Log:
adapt to new API

Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c   2011-03-25 08:48:14 UTC (rev 14715)
+++ gnunet/src/fs/gnunet-service-fs.c   2011-03-25 08:49:47 UTC (rev 14716)
@@ -1297,7 +1297,7 @@
       MIN_MIGRATION_CONTENT_LIFETIME.rel_value)
     {
       /* content will expire soon, don't bother */
-      GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
+      GNUNET_DATASTORE_get_next (dsh);
       return;
     }
   if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND)
@@ -1309,7 +1309,7 @@
                                            &process_migration_content,
                                            NULL))
        {
-         GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
+         GNUNET_DATASTORE_get_next (dsh);
        }
       return;
     }
@@ -1333,7 +1333,7 @@
   GNUNET_CONTAINER_multihashmap_iterate (connected_peers,
                                         &consider_migration,
                                         mb);
-  GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
+  GNUNET_DATASTORE_get_next (dsh);
 }
 
 
@@ -1344,7 +1344,7 @@
 dht_put_continuation (void *cls,
                      const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
+  GNUNET_DATASTORE_get_next (dsh);
 }
 
 
@@ -3984,7 +3984,7 @@
                                            pr))
       if (pr->qe != NULL)
        {
-         GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
+         GNUNET_DATASTORE_get_next (dsh);
        }
       return;
     }
@@ -4007,7 +4007,7 @@
                               -1, -1, 
                               GNUNET_TIME_UNIT_FOREVER_REL,
                               NULL, NULL);
-      GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
+      GNUNET_DATASTORE_get_next (dsh);
       return;
     }
   prq.type = type;
@@ -4026,7 +4026,7 @@
   if (prq.eval == GNUNET_BLOCK_EVALUATION_OK_LAST)
     {
       pr->local_only = GNUNET_YES; /* do not forward */
-      GNUNET_DATASTORE_get_next (dsh, GNUNET_NO);
+      GNUNET_DATASTORE_get_next (dsh);
       return;
     }
   if ( (pr->client_request_list == NULL) &&
@@ -4041,10 +4041,10 @@
                                gettext_noop ("# processing result set cut 
short due to load"),
                                1,
                                GNUNET_NO);
-      GNUNET_DATASTORE_get_next (dsh, GNUNET_NO);
+      GNUNET_DATASTORE_get_next (dsh);
       return;
     }
-  GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
+  GNUNET_DATASTORE_get_next (dsh);
 }
 
 

Modified: gnunet/src/fs/gnunet-service-fs_cp.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cp.c        2011-03-25 08:48:14 UTC (rev 
14715)
+++ gnunet/src/fs/gnunet-service-fs_cp.c        2011-03-25 08:49:47 UTC (rev 
14716)
@@ -562,17 +562,13 @@
  * @param expiration when does 'data' expire?
  * @param data response data, NULL on request expiration
  * @param data_len number of bytes in data
- * @param more GNUNET_YES if the request remains active (may call
- *             this function again), GNUNET_NO if the request is
- *             finished (client must not call GSF_pending_request_cancel_)
  */
 static void
 handle_p2p_reply (void *cls,
                  struct GSF_PendingRequest *pr,
                  struct GNUNET_TIME_Absolute expiration,
                  const void *data,
-                 size_t data_len,
-                 int more)
+                 size_t data_len)
 {
   struct GSF_ConnectedPeer *cp = cls;
   struct GSF_PendingRequestData *prd;
@@ -582,7 +578,6 @@
   prd = GSF_pending_request_get_data_ (pr);
   if (NULL == data)
     {
-      GNUNET_assert (GNUNET_NO == more);
       GNUNET_STATISTICS_update (GSF_stats,
                                gettext_noop ("# P2P searches active"),
                                -1,

Modified: gnunet/src/fs/gnunet-service-fs_lc.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_lc.c        2011-03-25 08:48:14 UTC (rev 
14715)
+++ gnunet/src/fs/gnunet-service-fs_lc.c        2011-03-25 08:49:47 UTC (rev 
14716)
@@ -192,17 +192,13 @@
  * @param expiration when does 'data' expire?
  * @param data response data, NULL on request expiration
  * @param data_len number of bytes in data
- * @param more GNUNET_YES if the request remains active (may call
- *             this function again), GNUNET_NO if the request is
- *             finished (client must not call GSF_pending_request_cancel_)
  */
 static void
 client_response_handler (void *cls,
                         struct GSF_PendingRequest *pr,
                         struct GNUNET_TIME_Absolute expiration,
                         const void *data,
-                        size_t data_len,
-                        int more)
+                        size_t data_len)
 {
   struct ClientRequest *cr = cls;
   struct GSF_LocalClient *lc;
@@ -214,7 +210,6 @@
     {
       /* ugh, request 'timed out' -- how can this be? */
       GNUNET_break (0);
-      GNUNET_assert (GNUNET_NO == more);
       return;
     }
   GNUNET_STATISTICS_update (GSF_stats,
@@ -238,19 +233,6 @@
              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);
-    }
 }
 
 

Modified: gnunet/src/fs/gnunet-service-fs_pr.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.c        2011-03-25 08:48:14 UTC (rev 
14715)
+++ gnunet/src/fs/gnunet-service-fs_pr.c        2011-03-25 08:49:47 UTC (rev 
14716)
@@ -333,8 +333,7 @@
          dpr->rh (dpr->rh_cls,
                   dpr,
                   GNUNET_TIME_UNIT_FOREVER_ABS,
-                  NULL, 0,
-                  GNUNET_SYSERR);
+                  NULL, 0);
          GSF_pending_request_cancel_ (dpr);
        }
     }
@@ -618,11 +617,6 @@
   enum GNUNET_BLOCK_EvaluationResult eval;
 
   /**
-   * Did we finish processing the associated request?
-   */ 
-  int finished;
-
-  /**
    * Did we find a matching request?
    */
   int request_found;
@@ -698,11 +692,7 @@
       pr->rh (pr->rh_cls,            
              pr,
              prq->expiration,
-             prq->data, prq->size, 
-             GNUNET_NO);
-      /* destroy request, we're done */
-      prq->finished = GNUNET_YES;
-      GSF_pending_request_cancel_ (pr);
+             prq->data, prq->size);
       return GNUNET_YES;
     case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
       GNUNET_STATISTICS_update (GSF_stats,
@@ -759,8 +749,7 @@
   pr->rh (pr->rh_cls,
          pr, 
          prq->expiration,
-         prq->data, prq->size, 
-         GNUNET_YES);
+         prq->data, prq->size);
   return GNUNET_YES;
 }
 
@@ -958,13 +947,16 @@
 {
   struct GSF_PendingRequest *pr = cls;
   GSF_LocalLookupContinuation cont;
-
   struct ProcessReplyClosure prq;
   GNUNET_HashCode query;
   unsigned int old_rf;
   
   if (NULL == key)
     {
+#if DEBUG_FS
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "No further local repsonses available.\n");
+#endif
       pr->qe = NULL;
       if (NULL != (cont = pr->llc_cont))
        {
@@ -998,7 +990,7 @@
                                            pr))
        {
          if (pr->qe != NULL)
-           GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_YES);        
+           GNUNET_DATASTORE_get_next (GSF_dsh);
        }
       return;
     }
@@ -1021,26 +1013,17 @@
                               -1, -1, 
                               GNUNET_TIME_UNIT_FOREVER_REL,
                               NULL, NULL);
-      GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_YES);
+      GNUNET_DATASTORE_get_next (GSF_dsh);
       return;
     }
   prq.type = type;
   prq.priority = priority;  
-  prq.finished = GNUNET_NO;
   prq.request_found = GNUNET_NO;
   prq.anonymity_level = anonymity;
   if ( (old_rf == 0) &&
        (pr->public_data.results_found == 0) )
     GSF_update_datastore_delay_ (pr->public_data.start_time);
   process_reply (&prq, key, pr);
-  if (prq.finished == GNUNET_YES)
-    {
-#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)
     {
@@ -1049,11 +1032,6 @@
                  "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);
-      return;
-    }
   if ( (0 == (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data.options)) &&
        ( (GNUNET_YES == GSF_test_get_load_too_high_ (0)) ||
         (pr->public_data.results_found > 5 + 2 * pr->public_data.priority) ) )
@@ -1066,10 +1044,18 @@
                                gettext_noop ("# processing result set cut 
short due to load"),
                                1,
                                GNUNET_NO);
-      GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_NO);
+      GNUNET_DATASTORE_cancel (pr->qe);
+      pr->qe = NULL;
+      if (NULL != (cont = pr->llc_cont))
+       {
+         pr->llc_cont = NULL;
+         cont (pr->llc_cont_cls,
+               pr,
+               pr->local_result);
+       }
       return;
     }
-  GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_YES);
+  GNUNET_DATASTORE_get_next (GSF_dsh);
 }
 
 
@@ -1162,7 +1148,6 @@
   prq.expiration = expiration;
   prq.priority = 0;
   prq.anonymity_level = 1;
-  prq.finished = GNUNET_NO;
   prq.request_found = GNUNET_NO;
   GNUNET_CONTAINER_multihashmap_get_multiple (pr_map,
                                              &query,

Modified: gnunet/src/fs/gnunet-service-fs_pr.h
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.h        2011-03-25 08:48:14 UTC (rev 
14715)
+++ gnunet/src/fs/gnunet-service-fs_pr.h        2011-03-25 08:49:47 UTC (rev 
14716)
@@ -162,16 +162,12 @@
  * @param expiration when does 'data' expire?
  * @param data response data, NULL on request expiration
  * @param data_len number of bytes in data
- * @param more GNUNET_YES if the request remains active (may call
- *             this function again), GNUNET_NO if the request is
- *             finished (client must not call GSF_pending_request_cancel_)
  */
 typedef void (*GSF_PendingRequestReplyHandler)(void *cls,
                                               struct GSF_PendingRequest *pr,
                                               struct GNUNET_TIME_Absolute 
expiration,
                                               const void *data,
-                                              size_t data_len,
-                                              int more);
+                                              size_t data_len);
 
 
 /**

Modified: gnunet/src/fs/gnunet-service-fs_push.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_push.c      2011-03-25 08:48:14 UTC (rev 
14715)
+++ gnunet/src/fs/gnunet-service-fs_push.c      2011-03-25 08:49:47 UTC (rev 
14716)
@@ -479,7 +479,7 @@
       MIN_MIGRATION_CONTENT_LIFETIME.rel_value)
     {
       /* content will expire soon, don't bother */
-      GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_YES);
+      GNUNET_DATASTORE_get_next (GSF_dsh);
       return;
     }
   if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND)
@@ -491,7 +491,7 @@
                                            &process_migration_content,
                                            NULL))
        {
-         GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_YES);
+         GNUNET_DATASTORE_get_next (GSF_dsh);
        }
       return;
     }
@@ -522,7 +522,7 @@
        }
       pos = pos->next;
     }
-  GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_YES);
+  GNUNET_DATASTORE_get_next (GSF_dsh);
 }
 
 

Modified: gnunet/src/fs/gnunet-service-fs_put.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_put.c       2011-03-25 08:48:14 UTC (rev 
14715)
+++ gnunet/src/fs/gnunet-service-fs_put.c       2011-03-25 08:49:47 UTC (rev 
14716)
@@ -109,7 +109,7 @@
 dht_put_continuation (void *cls,
                      const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  GNUNET_DATASTORE_get_next (GSF_dsh, GNUNET_YES);
+  GNUNET_DATASTORE_get_next (GSF_dsh);
 }
 
 




reply via email to

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