gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libextractor] 18/27: do not try to seek on SHM if we do no


From: gnunet
Subject: [GNUnet-SVN] [libextractor] 18/27: do not try to seek on SHM if we do not use SHM, even if (bad) plugin requests it
Date: Sun, 15 Oct 2017 21:34:42 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository libextractor.

commit f675653eefe612dae726104914a2da451ea77077
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Oct 15 20:41:16 2017 +0200

    do not try to seek on SHM if we do not use SHM, even if (bad) plugin 
requests it
---
 src/main/extractor.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/main/extractor.c b/src/main/extractor.c
index b51af84b..c35ebd8d 100644
--- a/src/main/extractor.c
+++ b/src/main/extractor.c
@@ -360,7 +360,7 @@ in_process_proc (void *cls,
  *        all plugins are in-process)
  * @param ds data to process
  * @param proc function to call for each meta data item found
- * @param proc_cls cls argument to proc
+ * @param proc_cls cls argument to @a proc
  */
 static void
 do_extract (struct EXTRACTOR_PluginList *plugins,
@@ -387,7 +387,10 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
   for (pos = plugins; NULL != pos; pos = pos->next)
     plugin_count++;
   if (NULL != shm)
-    ready = EXTRACTOR_IPC_shared_memory_set_ (shm, ds, 0, DEFAULT_SHM_SIZE);
+    ready = EXTRACTOR_IPC_shared_memory_set_ (shm,
+                                              ds,
+                                              0,
+                                              DEFAULT_SHM_SIZE);
   else
     ready = 0;
   have_in_memory = 0;
@@ -500,7 +503,8 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
        }
       data_available = -1;
       if ( (1 == done) &&
-          (-1 != min_seek) )
+          (-1 != min_seek) &&
+           (NULL != shm) )
        {
          /* current position done, but seek requested */
          done = 0;
@@ -642,6 +646,7 @@ EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins,
     }
   for (pos = plugins; NULL != pos; pos = pos->next)
     if ( (NULL == pos->channel) &&
+         (NULL != shm) &&
         (EXTRACTOR_OPTION_IN_PROCESS != pos->flags) )
       {
        if (NULL == pos->shm)
@@ -652,7 +657,11 @@ EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins,
        pos->channel = EXTRACTOR_IPC_channel_create_ (pos,
                                                      shm);
       }
-  do_extract (plugins, shm, datasource, proc, proc_cls);
+  do_extract (plugins,
+              shm,
+              datasource,
+              proc,
+              proc_cls);
   EXTRACTOR_datasource_destroy_ (datasource);
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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