mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-06 11:28:00 +00:00
BUG/MINOR: http: make smp_fetch_body() report that the contents may change
The req_body and res_body sample fetch functions forgot to set the SMP_F_MAY_CHANGE flag, making them unusable in tcp content rules. Now we set the flag as long as the channel is not full and nothing indicates the end was reached. This is marked as a bug because it's unusual for a sample fetch function to return a final verdict while data my change, but this results from a limitation that was affecting the legacy mode where it was not possible to know whether the end was reached without de-chunking the message. In HTX there is no more reason to limit this. This fix could be backported to 2.1, and to 2.0 if really needed, though it will only be doable for HTX, and legacy cannot be fixed.
This commit is contained in:
parent
bcefb85009
commit
9dc92b2650
@ -597,6 +597,10 @@ static int smp_fetch_body(const struct arg *args, struct sample *smp, const char
|
||||
smp->data.type = SMP_T_BIN;
|
||||
smp->data.u.str = *temp;
|
||||
smp->flags = SMP_F_VOL_TEST;
|
||||
|
||||
if (!channel_full(chn, global.tune.maxrewrite) && !(chn->flags & (CF_EOI|CF_SHUTR|CF_READ_ERROR)))
|
||||
smp->flags |= SMP_F_MAY_CHANGE;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user