gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r31693 - Extractor/src/main
Date: Sun, 22 Dec 2013 21:53:19 +0100

Author: LRN
Date: 2013-12-22 21:53:19 +0100 (Sun, 22 Dec 2013)
New Revision: 31693

Modified:
   Extractor/src/main/extractor_ipc_w32.c
Log:
Channel-killing logic for W32

Modified: Extractor/src/main/extractor_ipc_w32.c
===================================================================
--- Extractor/src/main/extractor_ipc_w32.c      2013-12-22 20:53:16 UTC (rev 
31692)
+++ Extractor/src/main/extractor_ipc_w32.c      2013-12-22 20:53:19 UTC (rev 
31693)
@@ -695,6 +695,7 @@
   unsigned int c;
   char *ndata;
   HANDLE events[MAXIMUM_WAIT_OBJECTS];
+  int closed_channel;
 
   c = 0;
   for (i = 0; i < num_channels; i++)
@@ -730,6 +731,26 @@
   if (first_ready == WAIT_TIMEOUT || first_ready == WAIT_FAILED)
   {
     /* an error or timeout -> something's wrong or all plugins hung up */
+    closed_channel = 0;
+    for (i = 0; i < num_channels; i++)
+    {
+      struct EXTRACTOR_Channel *channel = channels[i];
+      if (NULL == channel)
+        continue;
+      if (-1 == channel->plugin->seek_request)
+      {
+        /* plugin blocked for too long, kill the 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;
     LOG_STRERROR ("WaitForMultipleObjects");
     return -1;
   }




reply via email to

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