tracker r3052 - in trunk: . src/tracker-indexer



Author: carlosg
Date: Wed Mar 11 13:03:30 2009
New Revision: 3052
URL: http://svn.gnome.org/viewvc/tracker?rev=3052&view=rev

Log:
2009-03-11  Carlos Garnacho  <carlos imendio com>

        * src/tracker-indexer/tracker-module-metadata-utils.c
        (process_context_invalidate) (process_context_destroy): Merged
        together.
        (process_context_child_watch_cb): Removed obsolete code.
        (process_context_create): Set a 10 seconds timeout to extract text.
        Fixes #455588.

Modified:
   trunk/ChangeLog
   trunk/src/tracker-indexer/tracker-module-metadata-utils.c

Modified: trunk/src/tracker-indexer/tracker-module-metadata-utils.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-module-metadata-utils.c	(original)
+++ trunk/src/tracker-indexer/tracker-module-metadata-utils.c	Wed Mar 11 13:03:30 2009
@@ -49,6 +49,8 @@
 #define TEXT_MAX_SIZE		     1048576  /* bytes */
 #define TEXT_CHECK_SIZE		     65535    /* bytes */
 
+#define TEXT_EXTRACTION_TIMEOUT      10
+
 typedef struct {
 	GPid pid;
 	guint stdout_watch_id;
@@ -58,8 +60,6 @@
 	gpointer data;
 } ProcessContext;
 
-static ProcessContext *metadata_context = NULL;
-
 static DBusGProxy *
 get_dbus_extract_proxy (void)
 {
@@ -95,7 +95,7 @@
 }
 
 static void
-process_context_invalidate (ProcessContext *context)
+process_context_destroy (ProcessContext *context)
 {
 	if (context->stdin_channel) {
 		g_io_channel_shutdown (context->stdin_channel, FALSE, NULL);
@@ -127,12 +127,7 @@
 		g_spawn_close_pid (context->pid);
 		context->pid = 0;
 	}
-}
 
-static void
-process_context_destroy (ProcessContext *context)
-{
-	process_context_invalidate (context);
 	g_free (context);
 }
 
@@ -148,11 +143,6 @@
 		 status);
 
 	context = (ProcessContext *) user_data;
-
-	if (context == metadata_context) {
-		metadata_context = NULL;
-	}
-
 	process_context_destroy (context);
 }
 
@@ -166,7 +156,7 @@
 	GPid pid;
 
 	if (!tracker_spawn_async_with_channels (argv,
-						0,
+						TEXT_EXTRACTION_TIMEOUT,
 						&pid,
 						&stdin_channel,
 						&stdout_channel,



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