diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2022-10-22 22:48:54 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2022-10-23 13:46:25 +0200 |
commit | 6d5268955c9a7bda432c022f92060c5d30443c21 (patch) | |
tree | 6dded125f2c2288bd11e3af15c8b8876fab52786 /src | |
parent | c9fd77247bf7ea26e3f9bf532918a6ba69ae8dce (diff) | |
download | tracker-6d5268955c9a7bda432c022f92060c5d30443c21.tar.gz |
libtracker-sparql/bus: Pass cancellable to cursor_next() operations
Presumably reading a row of content is not an expensive operation in
most circumstances, anyhow it's still good to pass the cancellable to
the FD reading operations, so we bail out as soon as possible after
cancellation.
Diffstat (limited to 'src')
-rw-r--r-- | src/libtracker-sparql/bus/tracker-bus-cursor.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libtracker-sparql/bus/tracker-bus-cursor.c b/src/libtracker-sparql/bus/tracker-bus-cursor.c index ee0a08547..fab995d60 100644 --- a/src/libtracker-sparql/bus/tracker-bus-cursor.c +++ b/src/libtracker-sparql/bus/tracker-bus-cursor.c @@ -225,7 +225,7 @@ tracker_bus_cursor_next (TrackerSparqlCursor *cursor, * columns x 4 bytes for offsets] */ n_columns = g_data_input_stream_read_int32 (bus_cursor->data_stream, - NULL, NULL); + cancellable, NULL); if (n_columns == 0) { bus_cursor->finished = TRUE; @@ -236,16 +236,16 @@ tracker_bus_cursor_next (TrackerSparqlCursor *cursor, bus_cursor->types = g_new0 (TrackerSparqlValueType, n_columns); if (!g_input_stream_read_all (G_INPUT_STREAM (bus_cursor->data_stream), - bus_cursor->types, - n_columns * sizeof (gint32), - NULL, NULL, error)) + bus_cursor->types, + n_columns * sizeof (gint32), + NULL, cancellable, error)) return FALSE; offsets = g_new0 (gint32, n_columns); if (!g_input_stream_read_all (G_INPUT_STREAM (bus_cursor->data_stream), offsets, n_columns * sizeof (gint32), - NULL, NULL, error)) { + NULL, cancellable, error)) { g_free (offsets); return FALSE; } @@ -278,7 +278,7 @@ tracker_bus_cursor_next (TrackerSparqlCursor *cursor, if (!g_input_stream_read_all (G_INPUT_STREAM (bus_cursor->data_stream), bus_cursor->row_data, offsets[n_columns - 1] + 1, - NULL, NULL, error)) { + NULL, cancellable, error)) { g_free (offsets); return FALSE; } |