From 1fd0404b4c8fe5e6da8e04dfef44bf63a4af0a75 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Thu, 23 Aug 2012 17:55:05 +0200 Subject: SoupCache: add SoupContentProcessor support SoupCache now implements the SoupContentProcessor interface. This means that soup-message-io will ask it to wrap a given base stream. By doing that the cache will backup up every byte readed from that base stream into a local file using a SoupCacheInputStream. Apart from that, this removes all the old resource writing infrastructure that was moved to the new SoupCacheInputStream. The SoupCache just needs to pass a callback to the stream in order to be notified once the caching operation finishes. This also involves moving the caching decision from the "got-headers" callback to the _wrap_input() implementation. https://bugzilla.gnome.org/show_bug.cgi?id=682112 --- libsoup/soup-client-input-stream.c | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'libsoup/soup-client-input-stream.c') diff --git a/libsoup/soup-client-input-stream.c b/libsoup/soup-client-input-stream.c index ddcabaa5..78bc15f1 100644 --- a/libsoup/soup-client-input-stream.c +++ b/libsoup/soup-client-input-stream.c @@ -88,17 +88,6 @@ soup_client_input_stream_get_property (GObject *object, guint prop_id, } } -/* Temporary HACK to keep SoupCache working. See soup_client_input_stream_read_fn() - * and soup_client_input_stream_read_nonblocking(). - */ -static void -soup_client_input_stream_emit_got_chunk (SoupClientInputStream *stream, void *data, gssize nread) -{ - SoupBuffer *buffer = soup_buffer_new (SOUP_MEMORY_TEMPORARY, data, nread); - soup_message_got_chunk (stream->priv->msg, buffer); - soup_buffer_free (buffer); -} - static gssize soup_client_input_stream_read_fn (GInputStream *stream, void *buffer, @@ -114,12 +103,6 @@ soup_client_input_stream_read_fn (GInputStream *stream, if (nread == 0) g_signal_emit (stream, signals[EOF], 0); - /* Temporary HACK to keep SoupCache working */ - if (nread > 0) { - soup_client_input_stream_emit_got_chunk (SOUP_CLIENT_INPUT_STREAM (stream), - buffer, nread); - } - return nread; } @@ -137,12 +120,6 @@ soup_client_input_stream_read_nonblocking (GPollableInputStream *stream, if (nread == 0) g_signal_emit (stream, signals[EOF], 0); - /* Temporary HACK to keep SoupCache working */ - if (nread > 0) { - soup_client_input_stream_emit_got_chunk (SOUP_CLIENT_INPUT_STREAM (stream), - buffer, nread); - } - return nread; } -- cgit v1.2.1