diff options
author | Sergio Villar Senin <svillar@igalia.com> | 2012-08-23 17:55:05 +0200 |
---|---|---|
committer | Sergio Villar Senin <svillar@igalia.com> | 2012-12-18 16:06:06 +0100 |
commit | 1fd0404b4c8fe5e6da8e04dfef44bf63a4af0a75 (patch) | |
tree | a48b22a11c2a3dda62d1a989f7a620c12fab0c9d /libsoup/soup-client-input-stream.c | |
parent | d12d25e3515b329f65da8f276965fe46c7c628ac (diff) | |
download | libsoup-1fd0404b4c8fe5e6da8e04dfef44bf63a4af0a75.tar.gz |
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
Diffstat (limited to 'libsoup/soup-client-input-stream.c')
-rw-r--r-- | libsoup/soup-client-input-stream.c | 23 |
1 files changed, 0 insertions, 23 deletions
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; } |