diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2011-09-04 06:28:09 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2011-09-04 06:28:09 +0000 |
commit | 6807fa854da64166e84efd0074b1e4dfeb5d8b17 (patch) | |
tree | 998672af3a94f2eac0434cc138efa151ebcd603b /content/llcache.c | |
parent | 9ee4f6146e06f6d142cc98a2bc600a49b4a3ddc6 (diff) | |
download | netsurf-6807fa854da64166e84efd0074b1e4dfeb5d8b17.tar.gz netsurf-6807fa854da64166e84efd0074b1e4dfeb5d8b17.tar.bz2 |
Sniff content types where appropriate.
We never sniff for CSS, nor for non-page artefacts (e.g. treeview icons)
svn path=/trunk/netsurf/; revision=12707
Diffstat (limited to 'content/llcache.c')
-rw-r--r-- | content/llcache.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/content/llcache.c b/content/llcache.c index 3141ad05f..b02d0135f 100644 --- a/content/llcache.c +++ b/content/llcache.c @@ -1455,6 +1455,8 @@ nserror llcache_object_notify_users(llcache_object *object) if (handle->state == LLCACHE_FETCH_DATA && objstate >= LLCACHE_FETCH_DATA && object->source_len > handle->bytes) { + size_t orig_handle_read; + /* Construct HAD_DATA event */ event.type = LLCACHE_EVENT_HAD_DATA; event.data.data.buf = @@ -1466,9 +1468,13 @@ nserror llcache_object_notify_users(llcache_object *object) if (object->fetch.flags & LLCACHE_RETRIEVE_STREAM_DATA) { /* Streaming, so reset to zero to - * minimise amount of cached source data */ + * minimise amount of cached source data. + * Additionally, we don't support replay + * when streaming. */ + orig_handle_read = 0; handle->bytes = object->source_len = 0; } else { + orig_handle_read = handle->bytes; handle->bytes = object->source_len; } @@ -1483,6 +1489,15 @@ nserror llcache_object_notify_users(llcache_object *object) return error; continue; + } else if (error == NSERROR_NEED_DATA) { + /* User requested replay */ + handle->bytes = orig_handle_read; + + /* Continue with the next user -- we'll + * reemit the data next time round */ + user->iterator_target = false; + next_user = user->next; + continue; } else if (error != NSERROR_OK) { user->iterator_target = false; return error; |