txreq -req POST -body "ping"
rxresp
expect resp.status == 200
- expect resp.http.x-probe-order == "F.base-b;F1.local-c;F1.local-a;BA.local-c;BA.local-d;"
+ expect resp.http.x-probe-order == "BA.local-c;BA.local-d;F.base-b;F1.local-c;F1.local-a;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "pong"
} -run
txreq
rxresp
expect resp.status == 200
- expect resp.http.x-probe-order == "F.base-a;B.base-b;B.base-c;"
+ expect resp.http.x-probe-order == "B.base-b;B.base-c;F.base-a;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "sibling"
} -run
txreq -req POST -url /instances -body "first"
rxresp
expect resp.status == 200
- expect resp.http.x-probe-order == "F.b;F.a;D.c;D.a;"
- expect resp.http.x-probe-instances == "F.b:1;F.a:2;D.c:1;D.a:2;"
- expect resp.http.x-probe-request-bytes == "F.a:5;D.c:5;"
+ expect resp.http.x-probe-order == "D.c;D.a;F.b;F.a;"
+ expect resp.http.x-probe-instances == "D.c:1;D.a:2;F.b:1;F.a:2;"
+ expect resp.http.x-probe-request-bytes == "D.c:5;F.a:5;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "first response"
txreq -req POST -url /instances -body "fourth"
rxresp
expect resp.status == 200
- expect resp.http.x-probe-order == "F.b;F.a;D.c;D.a;"
- expect resp.http.x-probe-instances == "F.b:7;F.a:8;D.c:3;D.a:4;"
- expect resp.http.x-probe-request-bytes == "F.a:6;D.c:6;"
+ expect resp.http.x-probe-order == "D.c;D.a;F.b;F.a;"
+ expect resp.http.x-probe-instances == "D.c:3;D.a:4;F.b:7;F.a:8;"
+ expect resp.http.x-probe-request-bytes == "D.c:6;F.a:6;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "fourth response"
} -run
txreq -req POST -url /instances -body "new"
rxresp
expect resp.status == 200
- expect resp.http.x-probe-instances == "F.b:9;F.a:10;D.c:5;D.a:6;"
- expect resp.http.x-probe-request-bytes == "F.a:3;D.c:3;"
+ expect resp.http.x-probe-instances == "D.c:5;D.a:6;F.b:9;F.a:10;"
+ expect resp.http.x-probe-request-bytes == "D.c:3;F.a:3;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "new connection"
} -run
txreq
rxresp
expect resp.status == 200
- expect resp.http.x-probe-order == "F.b;F.a;B.c;B.a;"
- expect resp.http.x-probe-threads == "F.b:1;F.a:1;B.c:1;B.a:1;"
- expect resp.http.x-probe-instances == "F.b:1;F.a:2;B.c:2;B.a:1;"
+ expect resp.http.x-probe-order == "B.c;B.a;F.b;F.a;"
+ expect resp.http.x-probe-threads == "B.c:1;B.a:1;F.b:1;F.a:1;"
+ expect resp.http.x-probe-instances == "B.c:2;B.a:1;F.b:1;F.a:2;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "thread one"
} -run
txreq
rxresp
expect resp.status == 200
- expect resp.http.x-probe-order == "F.b;F.a;B.c;B.a;"
- expect resp.http.x-probe-threads == "F.b:2;F.a:2;B.c:2;B.a:2;"
- expect resp.http.x-probe-instances == "F.b:1;F.a:2;B.c:2;B.a:1;"
+ expect resp.http.x-probe-order == "B.c;B.a;F.b;F.a;"
+ expect resp.http.x-probe-threads == "B.c:2;B.a:2;F.b:2;F.a:2;"
+ expect resp.http.x-probe-instances == "B.c:2;B.a:1;F.b:1;F.a:2;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "thread two"
} -run
txreq
rxresp
expect resp.status == 200
- expect resp.http.x-probe-threads == "F.b:1;F.a:1;B.c:1;B.a:1;"
- expect resp.http.x-probe-instances == "F.b:3;F.a:4;B.c:4;B.a:3;"
+ expect resp.http.x-probe-threads == "B.c:1;B.a:1;F.b:1;F.a:1;"
+ expect resp.http.x-probe-instances == "B.c:4;B.a:3;F.b:3;F.a:4;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "thread one again"
} -run
txreq
rxresp
expect resp.status == 200
- expect resp.http.x-probe-threads == "F.b:2;F.a:2;B.c:2;B.a:2;"
- expect resp.http.x-probe-instances == "F.b:3;F.a:4;B.c:4;B.a:3;"
+ expect resp.http.x-probe-threads == "B.c:2;B.a:2;F.b:2;F.a:2;"
+ expect resp.http.x-probe-instances == "B.c:4;B.a:3;F.b:3;F.a:4;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "thread two again"
} -run
txreq -req POST -body "abcdefgh"
rxresp
expect resp.status == 200
- expect resp.http.x-probe-order == "F.c;F.a;F.b;B.a;B.c;B.b;"
- expect resp.http.x-probe-instances == "F.c:2;F.a:1;F.b:3;B.a:2;B.c:1;B.b:3;"
- expect resp.http.x-probe-request-bytes == "F.b:8;B.a:8;B.c:8;"
+ expect resp.http.x-probe-order == "B.a;B.c;B.b;F.c;F.a;F.b;"
+ expect resp.http.x-probe-instances == "B.a:2;B.c:1;B.b:3;F.c:2;F.a:1;F.b:3;"
+ expect resp.http.x-probe-request-bytes == "B.a:8;B.c:8;F.b:8;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "response after waits"
chunked ""
rxresp
expect resp.status == 200
- expect resp.http.x-probe-order == "F.c;F.a;F.b;B.a;B.c;B.b;"
- expect resp.http.x-probe-instances == "F.c:5;F.a:4;F.b:6;B.a:5;B.c:4;B.b:6;"
- expect resp.http.x-probe-request-bytes == "F.b:8;B.a:8;B.c:8;"
+ expect resp.http.x-probe-order == "B.a;B.c;B.b;F.c;F.a;F.b;"
+ expect resp.http.x-probe-instances == "B.a:5;B.c:4;B.b:6;F.c:5;F.a:4;F.b:6;"
+ expect resp.http.x-probe-request-bytes == "B.a:8;B.c:8;F.b:8;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "another response"
barrier b_drained sync
expect resp.status == 200
expect resp.http.x-retries == "1"
expect resp.http.x-redispatched == "1"
- expect resp.http.x-probe-order == "F.b;F.a;B.a;B.c;"
- expect resp.http.x-probe-instances == "F.b:1;F.a:2;B.a:2;B.c:1;"
+ expect resp.http.x-probe-order == "B.a;B.c;F.b;F.a;"
+ expect resp.http.x-probe-instances == "B.a:2;B.c:1;F.b:1;F.a:2;"
expect resp.http.x-probe-errors == <undef>
expect resp.body == "successful retry"
barrier b_drained sync
txreq -req POST -body "ping"
rxresp
expect resp.status == 200
- expect resp.http.x-filter-order == "Fb:3;Fc:1;Fa:2;Ba:2;Bb:1;Bc:3;"
+ expect resp.http.x-filter-order == "Ba:2;Bb:1;Bc:3;Fb:3;Fc:1;Fa:2;"
expect resp.http.x-filter-start == <undef>
expect resp.body == "pong"
} -run
txreq
rxresp
expect resp.status == 200
- expect resp.http.x-filter-order == "Fa:1;Fb:2;Ba:1;Bb:2;"
+ expect resp.http.x-filter-order == "Ba:1;Bb:2;Fa:1;Fb:2;"
expect resp.http.x-filter-start == <undef>
} -run
* configuration pointers to build the channel lists; disabled, incompatible
* or declined filters have no stream filter instance to link. Never store
* per-stream pointers in shared filter instances.
+ *
+ * The request list is always filled in the proxy's request order. The
+ * response list is filled in the proxy's response order for the frontend
+ * filters, but the backend filters are prepended, so a response reaches the
+ * backend filters before the frontend ones.
*/
static int flt_stream_add_proxy_filters(struct stream *s, struct proxy *px, unsigned int flags)
{
}
}
}
- list_for_each_entry(inst, &px->filter_res_instances, res.list) {
- if (!inst->enabled || !inst->fconf)
- continue;
- list_for_each_entry(filter, &strm_flt(s)->filters, list) {
- if (filter->config == inst->fconf) {
- LIST_APPEND(&s->res.flt.filters, &filter->res_list);
- break;
+ if (flags & FLT_FL_IS_BACKEND_FILTER) {
+ list_for_each_entry_rev(inst, &px->filter_res_instances, res.list) {
+ if (!inst->enabled || !inst->fconf)
+ continue;
+ list_for_each_entry(filter, &strm_flt(s)->filters, list) {
+ if (filter->config == inst->fconf) {
+ LIST_INSERT(&s->res.flt.filters, &filter->res_list);
+ break;
+ }
+ }
+ }
+ }
+ else {
+ list_for_each_entry(inst, &px->filter_res_instances, res.list) {
+ if (!inst->enabled || !inst->fconf)
+ continue;
+ list_for_each_entry(filter, &strm_flt(s)->filters, list) {
+ if (filter->config == inst->fconf) {
+ LIST_APPEND(&s->res.flt.filters, &filter->res_list);
+ break;
+ }
}
}
}