if (chn->flt.current) {
filter = chn->flt.current;
- chn->flt.current = NULL;
if (!(chn_prod(chn)->flags & SC_FL_ERROR) &&
!(chn->flags & (CF_READ_TIMEOUT|CF_WRITE_TIMEOUT))) {
(strm)->waiting_entity.type = STRM_ENTITY_NONE;
(strm)->waiting_entity.ptr = NULL;
}
}
- else
+ else {
filter = flt_list_start(strm, chn);
+ chn->flt.current = filter;
+ }
return filter;
}
static inline struct filter *resume_filter_list_next(struct stream *strm, struct channel *chn,
struct filter *filter)
{
- /* simply an alias to flt_list_next() */
- return flt_list_next(strm, chn, filter);
+ filter = flt_list_next(strm, chn, filter);
+ chn->flt.current = filter;
+ return filter;
}
static inline void resume_filter_list_break(struct stream *strm, struct channel *chn,
struct filter *filter, int ret)
{
+ chn->flt.current = NULL;
if (ret == 0) {
strm->waiting_entity.type = STRM_ENTITY_FILTER;
strm->waiting_entity.ptr = filter;
+ chn->flt.current = filter;
}
else if (ret < 0) {
strm->last_entity.type = STRM_ENTITY_FILTER;
strm->last_entity.ptr = filter;
}
- chn->flt.current = filter;
}
/* List head of all known filter keywords */
if (HAS_FILTERS(strm) && strm->req.flt.current) {
const struct filter *flt = strm->req.flt.current;
- chunk_appendf(buf, "%s current_filter=%p (id=\"%s\" flags=0x%x pre=0x%x post=0x%x) \n", pfx,
- flt, flt->config->id, flt->flags, flt->pre_analyzers, flt->post_analyzers);
+ chunk_appendf(buf, "%s current_filter=%p (id=\"%s\" flags=0x%x pre=0x%x post=0x%x %s) \n", pfx,
+ flt, flt->config->id, flt->flags, flt->pre_analyzers, flt->post_analyzers,
+ (flt == strm->waiting_entity.ptr) ? "YIELDING" : "RUNNING");
}
chunk_appendf(buf,
if (HAS_FILTERS(strm) && strm->res.flt.current) {
const struct filter *flt = strm->res.flt.current;
- chunk_appendf(buf, "%s current_filter=%p (id=\"%s\" flags=0x%x pre=0x%x post=0x%x) \n", pfx,
- flt, flt->config->id, flt->flags, flt->pre_analyzers, flt->post_analyzers);
+ chunk_appendf(buf, "%s current_filter=%p (id=\"%s\" flags=0x%x pre=0x%x post=0x%x %s) \n", pfx,
+ flt, flt->config->id, flt->flags, flt->pre_analyzers, flt->post_analyzers,
+ (flt == strm->waiting_entity.ptr) ? "YIELDING" : "RUNNING");
}
if (strm->current_rule_list && strm->current_rule) {