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



Author: carlosg
Date: Mon Oct 20 12:12:15 2008
New Revision: 2397
URL: http://svn.gnome.org/viewvc/tracker?rev=2397&view=rev

Log:
2008-10-20  Carlos Garnacho  <carlos imendio com>

        * src/tracker-indexer/tracker-metadata-utils.c
        (get_file_content_read_cb): Issue error and quit the channel watch on
        error, this should fix misterious crashes with i.e. invalid UTF8
        coming from the text filters.


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

Modified: trunk/src/tracker-indexer/tracker-metadata-utils.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-metadata-utils.c	(original)
+++ trunk/src/tracker-indexer/tracker-metadata-utils.c	Mon Oct 20 12:12:15 2008
@@ -369,18 +369,23 @@
 
 	if (condition & G_IO_IN || condition & G_IO_PRI) {
 		do {
-			status = g_io_channel_read_line (channel, &line, NULL, NULL, NULL);
+			GError *error = NULL;
+
+			status = g_io_channel_read_line (channel, &line, NULL, NULL, &error);
 
 			if (status == G_IO_STATUS_NORMAL) {
 				g_string_append (text, line);
 				g_free (line);
+			} else if (error) {
+				g_warning (error->message);
+				g_error_free (error);
 			}
 		} while (status == G_IO_STATUS_NORMAL);
 
 		if (status == G_IO_STATUS_EOF ||
 		    status == G_IO_STATUS_ERROR) {
 			g_main_loop_quit (context->data_incoming_loop);
-			return TRUE;
+			return FALSE;
 		}
 	}
 



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