X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=filter_chain.c;h=5b87b087f6075770ab3a84a8bdbdac814afb99a4;hp=2510e49de1debf6122f52117702eb38fe7e472c3;hb=633f7c0f0194cd8ec3a478d820f55dd6a752d915;hpb=40cbbb95e256e63e1e6958e9034311d4904604af diff --git a/filter_chain.c b/filter_chain.c index 2510e49d..5b87b087 100644 --- a/filter_chain.c +++ b/filter_chain.c @@ -117,6 +117,10 @@ void filter_pre_select(__a_unused struct sched *s, struct task *t) char *ib; size_t *loaded; int conv, conv_total = 0; + + t->ret = -E_FC_EOF; + if (*fc->output_eof) + goto err_out; again: ib = fc->inbuf; loaded = fc->in_loaded; @@ -128,7 +132,7 @@ again: fc, *loaded, fn->filter->name); t->ret = fn->filter->convert(ib, *loaded, fn); if (t->ret < 0) - return; + goto err_out; call_callbacks(fn, ib, t->ret, fn->buf + old_fn_loaded, fn->loaded - old_fn_loaded); *loaded -= t->ret; @@ -143,18 +147,19 @@ again: loaded = &fn->loaded; } conv_total += conv; - PARA_DEBUG_LOG("reader eof: %d, eof: %d out_loaded: %d, conv: %d, conv_total: %d\n", *fc->reader_eof, - fc->eof, *fc->out_loaded, conv, conv_total); + PARA_DEBUG_LOG("eof (in/out/fc): %d/%d/%d out_loaded: %d, conv: %d, conv_total: %d\n", *fc->input_eof, + *fc->output_eof, fc->eof, *fc->out_loaded, conv, conv_total); if (conv) goto again; t->ret = 1; - if (!*fc->reader_eof) + if (!*fc->input_eof) return; if (*fc->out_loaded) return; if (*fc->in_loaded && conv_total) return; t->ret = -E_FC_EOF; +err_out: fc->eof = 1; }