summaryrefslogtreecommitdiff
path: root/libsoup/soup-cache.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2015-02-19 14:59:12 +0100
committerCarlos Garcia Campos <carlosgc@gnome.org>2015-03-02 09:42:37 +0100
commitaf2b1e75131cd7043fb243f7e84b5199372103fb (patch)
tree406c456e114d77aa949a7d1a97e41ba1965004e8 /libsoup/soup-cache.c
parent02f805dbf54dc6a30b53aa3b1607fd2c911e411f (diff)
downloadlibsoup-af2b1e75131cd7043fb243f7e84b5199372103fb.tar.gz
cache: Do not unqueue messages of cached resources until finished
We were marking the message is FINISHING right after returning the response, so that the message was unqueued while the client is still reading the input stream. This is inconsistent with normal messages and can confuse clients that connect to request-queued and request-unqueued signals to track messages. https://bugzilla.gnome.org/show_bug.cgi?id=744788
Diffstat (limited to 'libsoup/soup-cache.c')
-rw-r--r--libsoup/soup-cache.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libsoup/soup-cache.c b/libsoup/soup-cache.c
index 90fce5a4..d5f5586d 100644
--- a/libsoup/soup-cache.c
+++ b/libsoup/soup-cache.c
@@ -34,6 +34,7 @@
#include "soup-cache.h"
#include "soup-body-input-stream.h"
+#include "soup-cache-client-input-stream.h"
#include "soup-cache-input-stream.h"
#include "soup-cache-private.h"
#include "soup-content-processor.h"
@@ -671,7 +672,7 @@ GInputStream *
soup_cache_send_response (SoupCache *cache, SoupMessage *msg)
{
SoupCacheEntry *entry;
- GInputStream *file_stream, *body_stream, *cache_stream;
+ GInputStream *file_stream, *body_stream, *cache_stream, *client_stream;
GFile *file;
g_return_val_if_fail (SOUP_IS_CACHE (cache), NULL);
@@ -714,7 +715,10 @@ soup_cache_send_response (SoupCache *cache, SoupMessage *msg)
SOUP_STAGE_ENTITY_BODY);
g_object_unref (body_stream);
- return cache_stream;
+ client_stream = soup_cache_client_input_stream_new (cache_stream);
+ g_object_unref (cache_stream);
+
+ return client_stream;
}
static void