From fa05ee570c3cb30565738850e74f50e8726317ba Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 25 Dec 2004 18:58:04 +0000 Subject: [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 --- riscos/plugin.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'riscos/plugin.c') 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")); -- cgit v1.2.3