gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r30550 - gnunet/src/fs
Date: Tue, 5 Nov 2013 23:19:43 +0100

Author: grothoff
Date: 2013-11-05 23:19:43 +0100 (Tue, 05 Nov 2013)
New Revision: 30550

Modified:
   gnunet/src/fs/fs_api.c
   gnunet/src/fs/fs_download.c
   gnunet/src/fs/fs_search.c
Log:
-stylistic fixes

Modified: gnunet/src/fs/fs_api.c
===================================================================
--- gnunet/src/fs/fs_api.c      2013-11-05 22:19:28 UTC (rev 30549)
+++ gnunet/src/fs/fs_api.c      2013-11-05 22:19:43 UTC (rev 30550)
@@ -313,7 +313,7 @@
 {
   struct GNUNET_FS_QueueEntry *qe;
 
-  qe = GNUNET_malloc (sizeof (struct GNUNET_FS_QueueEntry));
+  qe = GNUNET_new (struct GNUNET_FS_QueueEntry);
   qe->h = h;
   qe->start = start;
   qe->stop = stop;
@@ -2298,7 +2298,7 @@
  *
  * @param cls the 'struct GNUNET_FS_SearchContext*'
  * @param filename complete filename (absolute path)
- * @return GNUNET_OK (continue to iterate)
+ * @return #GNUNET_OK (continue to iterate)
  */
 static int
 deserialize_search_result (void *cls, const char *filename)
@@ -2332,7 +2332,7 @@
   uris = NULL;
   download = NULL;
   update_srch = NULL;
-  sr = GNUNET_malloc (sizeof (struct GNUNET_FS_SearchResult));
+  sr = GNUNET_new (struct GNUNET_FS_SearchResult);
   sr->h = sc->h;
   sr->sc = sc;
   sr->serialization = ser;
@@ -2398,7 +2398,8 @@
     GNUNET_free (update_srch);
   }
   GNUNET_break (GNUNET_YES ==
-               GNUNET_CONTAINER_multihashmap_put (sc->master_result_map, 
&sr->key, sr,
+               GNUNET_CONTAINER_multihashmap_put (sc->master_result_map,
+                                                   &sr->key, sr,
                                                   
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE));
   if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg))
   {
@@ -2588,7 +2589,7 @@
  *
  * @param cls the 'struct GNUNET_FS_DownloadContext*' (parent)
  * @param filename complete filename (absolute path)
- * @return GNUNET_OK (continue to iterate)
+ * @return #GNUNET_OK (continue to iterate)
  */
 static int
 deserialize_subdownload (void *cls, const char *filename)
@@ -2678,7 +2679,7 @@
 
   uris = NULL;
   emsg = NULL;
-  dc = GNUNET_malloc (sizeof (struct GNUNET_FS_DownloadContext));
+  dc = GNUNET_new (struct GNUNET_FS_DownloadContext);
   dc->parent = parent;
   dc->h = h;
   dc->serialization = GNUNET_strdup (serialization);
@@ -2807,7 +2808,7 @@
   }
   uris = NULL;
   emsg = NULL;
-  sc = GNUNET_malloc (sizeof (struct GNUNET_FS_SearchContext));
+  sc = GNUNET_new (struct GNUNET_FS_SearchContext);
   if (NULL != psearch_result)
   {
     sc->psearch_result = psearch_result;
@@ -2868,7 +2869,7 @@
  *
  * @param cls the 'struct GNUNET_FS_Handle*'
  * @param filename complete filename (absolute path)
- * @return GNUNET_OK (continue to iterate)
+ * @return #GNUNET_OK (continue to iterate)
  */
 static int
 deserialize_search_file (void *cls, const char *filename)
@@ -2919,7 +2920,7 @@
  *
  * @param cls the 'struct GNUNET_FS_Handle*'
  * @param filename complete filename (absolute path)
- * @return GNUNET_OK (continue to iterate)
+ * @return #GNUNET_OK (continue to iterate)
  */
 static int
 deserialize_download_file (void *cls, const char *filename)

Modified: gnunet/src/fs/fs_download.c
===================================================================
--- gnunet/src/fs/fs_download.c 2013-11-05 22:19:28 UTC (rev 30549)
+++ gnunet/src/fs/fs_download.c 2013-11-05 22:19:43 UTC (rev 30550)
@@ -934,7 +934,7 @@
  * @param cls closure (our 'struct ProcessResultClosure')
  * @param key query for the given value / request
  * @param value value in the hash map (a 'struct DownloadRequest')
- * @return GNUNET_YES (we should continue to iterate); unless serious error
+ * @return #GNUNET_YES (we should continue to iterate); unless serious error
  */
 static int
 process_result_with_request (void *cls, const struct GNUNET_HashCode * key,
@@ -1492,7 +1492,7 @@
 /**
  * We must stop to ask the FS service for our blocks.  Pause the download.
  *
- * @param cls the 'struct GNUNET_FS_DownloadContext'
+ * @param cls the `struct GNUNET_FS_DownloadContext`
  */
 static void
 deactivate_fs_download (void *cls)

Modified: gnunet/src/fs/fs_search.c
===================================================================
--- gnunet/src/fs/fs_search.c   2013-11-05 22:19:28 UTC (rev 30549)
+++ gnunet/src/fs/fs_search.c   2013-11-05 22:19:43 UTC (rev 30550)
@@ -1326,7 +1326,8 @@
  * @return #GNUNET_OK
  */
 static int
-search_result_freeze_probes (void *cls, const struct GNUNET_HashCode * key,
+search_result_freeze_probes (void *cls,
+                             const struct GNUNET_HashCode *key,
                              void *value)
 {
   struct GNUNET_FS_SearchResult *sr = value;
@@ -1396,21 +1397,12 @@
     GNUNET_FS_download_signal_suspend_ (sr->download);
     sr->download = NULL;
   }
-  if (NULL != sr->probe_ctx)
-  {
-    GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES);
-    sr->probe_ctx = NULL;
-  }
-  if (GNUNET_SCHEDULER_NO_TASK != sr->probe_ping_task)
-  {
-    GNUNET_SCHEDULER_cancel (sr->probe_ping_task);
-    sr->probe_ping_task = GNUNET_SCHEDULER_NO_TASK;
-  }
   if (NULL != sr->update_search)
   {
     GNUNET_FS_search_signal_suspend_ (sr->update_search);
     sr->update_search = NULL;
   }
+  GNUNET_FS_search_stop_probe_ (sr);
   pi.status = GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND;
   pi.value.search.specifics.result_suspend.cctx = sr->client_info;
   pi.value.search.specifics.result_suspend.meta = sr->meta;
@@ -1420,11 +1412,6 @@
   GNUNET_free_non_null (sr->serialization);
   GNUNET_FS_uri_destroy (sr->uri);
   GNUNET_CONTAINER_meta_data_destroy (sr->meta);
-  if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
-  {
-    GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
-    sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
-  }
   GNUNET_free_non_null (sr->keyword_bitmap);
   GNUNET_free (sr);
   return GNUNET_OK;
@@ -1435,7 +1422,7 @@
  * Create SUSPEND event for the given search operation
  * and then clean up our state (without stop signal).
  *
- * @param cls the 'struct GNUNET_FS_SearchContext' to signal for
+ * @param cls the `struct GNUNET_FS_SearchContext` to signal for
  */
 void
 GNUNET_FS_search_signal_suspend_ (void *cls)
@@ -1451,9 +1438,15 @@
   sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc);
   GNUNET_break (NULL == sc->client_info);
   if (sc->task != GNUNET_SCHEDULER_NO_TASK)
+  {
     GNUNET_SCHEDULER_cancel (sc->task);
+    sc->task = GNUNET_SCHEDULER_NO_TASK;
+  }
   if (NULL != sc->client)
+  {
     GNUNET_CLIENT_disconnect (sc->client);
+    sc->client = NULL;
+  }
   GNUNET_CONTAINER_multihashmap_destroy (sc->master_result_map);
   if (NULL != sc->requests)
   {
@@ -1509,8 +1502,10 @@
   struct GNUNET_FS_ProgressInfo pi;
 
   if (GNUNET_SCHEDULER_NO_TASK != sc->task)
+  {
     GNUNET_SCHEDULER_cancel (sc->task);
-  sc->task = GNUNET_SCHEDULER_NO_TASK;
+    sc->task = GNUNET_SCHEDULER_NO_TASK;
+  }
   if (NULL != sc->client)
     GNUNET_CLIENT_disconnect (sc->client);
   sc->client = NULL;
@@ -1549,17 +1544,18 @@
  * @param cls the global FS handle
  * @param key the key for the search result (unused)
  * @param value the search result to free
- * @return GNUNET_OK
+ * @return #GNUNET_OK
  */
 static int
-search_result_stop (void *cls, const struct GNUNET_HashCode * key, void *value)
+search_result_stop (void *cls,
+                    const struct GNUNET_HashCode *key,
+                    void *value)
 {
   struct GNUNET_FS_SearchContext *sc = cls;
   struct GNUNET_FS_SearchResult *sr = value;
   struct GNUNET_FS_ProgressInfo pi;
 
   GNUNET_FS_search_stop_probe_ (sr);
-
   if (NULL != sr->download)
   {
     sr->download->search = NULL;
@@ -1593,10 +1589,12 @@
  * @param cls the global FS handle
  * @param key the key for the search result (unused)
  * @param value the search result to free
- * @return GNUNET_OK
+ * @return #GNUNET_OK
  */
 static int
-search_result_free (void *cls, const struct GNUNET_HashCode * key, void *value)
+search_result_free (void *cls,
+                    const struct GNUNET_HashCode *key,
+                    void *value)
 {
   struct GNUNET_FS_SearchResult *sr = value;
 




reply via email to

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