X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=filter.c;h=cfa2e94fad98aa255d38bb22dc9906f6fe863c3f;hp=79ae4dcbd22ef01e9ae44cdb90d02c9d6c5c570e;hb=b0cad48a864fe3f621138e717ff025060c396fad;hpb=40cbbb95e256e63e1e6958e9034311d4904604af diff --git a/filter.c b/filter.c index 79ae4dcb..cfa2e94f 100644 --- a/filter.c +++ b/filter.c @@ -55,7 +55,7 @@ __printf_2_3 void para_log(int ll, const char* fmt,...) void filter_event_handler(struct task *t) { - PARA_ERROR_LOG("%s\n", PARA_STRERROR(-t->ret)); + PARA_NOTICE_LOG("%s\n", PARA_STRERROR(-t->ret)); unregister_task(t); } @@ -81,7 +81,13 @@ static int init_filter_chain(void) fc->inbuf = sit->buf; fc->in_loaded = &sit->loaded; - fc->reader_eof = &sit->eof; + fc->input_eof = &sit->eof; + fc->eof = 0; + fc->output_eof = &sot->eof; + fc->task.private_data = fc; + fc->task.pre_select = filter_pre_select; + fc->task.event_handler = filter_event_handler; + sprintf(fc->task.status, "filter chain"); for (i = 0; i < conf.filter_given; i++) { char *fa = conf.filter_arg[i]; @@ -99,10 +105,6 @@ static int init_filter_chain(void) } if (list_empty(&fc->filters)) return -E_NO_FILTERS; - fc->task.private_data = fc; - fc->task.pre_select = filter_pre_select; - fc->task.event_handler = filter_event_handler; - sprintf(fc->task.status, "filter chain"); open_filters(); return 1; } @@ -153,15 +155,17 @@ int main(int argc, char *argv[]) goto out; stdout_set_defaults(sot); + PARA_EMERG_LOG("fc->output_eof: %d\n", *fc->output_eof); sot->buf = fc->outbuf; sot->loaded = fc->out_loaded; - sot->eof = &fc->eof; + sot->input_eof = &fc->eof; register_task(&sot->task); register_task(&fc->task); register_task(&sit->task); s.default_timeout.tv_sec = 1; s.default_timeout.tv_usec = 0; + PARA_EMERG_LOG("fc->output_eof: %d\n", *fc->output_eof); ret = sched(&s); out: free(sit->buf);