[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
This commit is contained in:
John Mark Bell 2004-12-25 18:58:04 +00:00
parent a36f92554a
commit fa05ee570c
2 changed files with 9 additions and 3 deletions

View File

@ -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"));

View File

@ -34,7 +34,6 @@ struct content_plugin_data {
unsigned int consumed; /* size of data consumed by plugin */
bool reformat_pending; /* is a reformat pending? */
int width, height; /* reformat width & height */
bool stream_waiting; /* waiting to stream a datastream */
bool file_stream_waiting; /* waiting to stream as file */
};