gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r31687 - Extractor/src/main


From: gnunet
Subject: [GNUnet-SVN] r31687 - Extractor/src/main
Date: Sun, 22 Dec 2013 18:55:45 +0100

Author: grothoff
Date: 2013-12-22 18:55:45 +0100 (Sun, 22 Dec 2013)
New Revision: 31687

Modified:
   Extractor/src/main/extractor_ipc_gnu.c
Log:
fixing issue with one plugin blocking processing preventing others from ever 
seeking -- GNU only

Modified: Extractor/src/main/extractor_ipc_gnu.c
===================================================================
--- Extractor/src/main/extractor_ipc_gnu.c      2013-12-22 17:55:27 UTC (rev 
31686)
+++ Extractor/src/main/extractor_ipc_gnu.c      2013-12-22 17:55:45 UTC (rev 
31687)
@@ -447,6 +447,7 @@
   ssize_t ret;
   ssize_t iret;
   char *ndata;
+  int closed_channel;
 
   FD_ZERO (&to_check);
   max = -1;
@@ -468,6 +469,27 @@
   if (0 >= select (max + 1, &to_check, NULL, NULL, &tv))
     {
       /* an error or timeout -> something's wrong or all plugins hung up */
+      closed_channel = 0;
+      for (i=0;i<num_channels;i++)
+        {
+          channel = channels[i];
+          if (NULL == channel)
+            continue;
+          if (-1 == channel->plugin->seek_request)
+          {
+            /* plugin blocked for too long, kill channel */
+            LOG ("Channel blocked, closing channel to %s\n",
+                 channel->plugin->libname);
+            channel->plugin->channel = NULL;
+            channel->plugin->round_finished = 1;
+            EXTRACTOR_IPC_channel_destroy_ (channel);
+            channels[i] = NULL;
+            closed_channel = 1;
+          }
+        }
+      if (1 == closed_channel)
+        return 1;
+      /* strange, no channel is to blame, let's die just to be safe */
       if ((EINTR != errno) && (0 != errno))
        LOG_STRERROR ("select");
       return -1;
@@ -511,7 +533,8 @@
        {
          if (-1 == iret)
            LOG_STRERROR ("read");
-         LOG ("Read error from channel, closing channel %d\n", i+1);
+         LOG ("Read error from channel, closing channel %s\n",
+               channel->plugin->libname);
          EXTRACTOR_IPC_channel_destroy_ (channel);
          channels[i] = NULL;
        }




reply via email to

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