summaryrefslogtreecommitdiff
path: root/riscos/plugin.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-12-25 18:58:04 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-12-25 18:58:04 +0000
commitfa05ee570c3cb30565738850e74f50e8726317ba (patch)
tree012c0aead6f0c6ad16d1c218ab92c9e15390cb67 /riscos/plugin.c
parenta36f92554aa995478b2efae87fd4407a26e30675 (diff)
downloadnetsurf-fa05ee570c3cb30565738850e74f50e8726317ba.tar.gz
netsurf-fa05ee570c3cb30565738850e74f50e8726317ba.tar.bz2
[project @ 2004-12-25 18:58:04 by jmb]
Fix issue with streaming as file when handling unknown content length (plugin_convert may have been called prior to the streaming being set up, thus resulting in the file not being streamed) Lose spurious boolean in plugin_data struct. svn path=/import/netsurf/; revision=1411
Diffstat (limited to 'riscos/plugin.c')
-rw-r--r--riscos/plugin.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/riscos/plugin.c b/riscos/plugin.c
index ce5f7022d..03692c262 100644
--- a/riscos/plugin.c
+++ b/riscos/plugin.c
@@ -126,7 +126,6 @@ bool plugin_create(struct content *c, const char *params[])
c->data.plugin.reformat_pending = false;
c->data.plugin.width = 0;
c->data.plugin.height = 0;
- c->data.plugin.stream_waiting = false;
c->data.plugin.file_stream_waiting = false;
return true;
}
@@ -711,7 +710,15 @@ void plugin_stream_new(wimp_message *message)
if (stream_type == 3) {
LOG(("as file"));
- if (c->source_size == c->total_size)
+ /* received all data => go ahead and stream
+ * we have to check the content's status too, as
+ * we could be dealing with a stream of unknown
+ * length (ie c->total_size == 0). If the status
+ * is CONTENT_STATUS_DONE, we've received all the
+ * data anyway, regardless of the total size.
+ */
+ if (c->source_size == c->total_size ||
+ c->status == CONTENT_STATUS_DONE)
plugin_write_stream_as_file(c);
else {
LOG(("waiting for data"));