/* This function ensures that the prerequisites for an L7 fetch are ready,
* which means that a request or response is ready. If some data is missing,
* a parsing attempt is made. This is useful in TCP-based ACLs which are able
- * to extract data from L7.
+ * to extract data from L7. If <vol> is non-null during a prefetch, another
+ * test is made to ensure the required information is not gone.
*
* The function returns :
* NULL with SMP_F_MAY_CHANGE in the sample flags if some data is missing to
* we'll never have any HTTP message there ;
* The HTX message if ready
*/
-struct htx *smp_prefetch_htx(struct sample *smp, struct channel *chn)
+struct htx *smp_prefetch_htx(struct sample *smp, struct channel *chn, int vol)
{
struct stream *s = smp->strm;
struct http_txn *txn = NULL;
}
}
sl = http_find_stline(htx);
- if (!sl) {
+ if (vol && !sl) {
/* The start-line was already forwarded, it is too late to fetch anything */
return NULL;
}
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 0);
if (!htx)
return 0;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct htx_sl *sl;
if (!htx)
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct htx_sl *sl;
if (!htx)
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct htx_sl *sl;
if (!htx)
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct buffer *temp;
int32_t pos;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct buffer *temp;
char *p, *end;
int32_t pos;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
int32_t pos;
if (!htx)
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
int32_t pos;
unsigned long long len = 0;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
int32_t pos;
unsigned long long len = 0;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct htx_sl *sl;
if (!htx)
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct htx_sl *sl;
if (!htx)
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct htx_sl *sl;
if (!htx)
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct http_hdr_ctx *ctx = smp->ctx.a[0];
struct ist name;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct http_hdr_ctx ctx;
struct ist name;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
int32_t pos;
if (!htx)
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct http_hdr_ctx *ctx = smp->ctx.a[0];
struct ist name;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct http_hdr_ctx ctx;
struct ist name;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct htx_sl *sl;
struct ist path;
size_t len;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct htx_sl *sl;
struct http_hdr_ctx ctx;
struct ist path;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct htx_sl *sl;
struct http_hdr_ctx ctx;
struct ist path;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct htx_sl *sl;
if (!htx)
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 0);
if (!htx)
return 0;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
if (!htx)
return 0;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
if (!htx)
return 0;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct http_hdr_ctx *ctx = smp->ctx.a[2];
struct ist hdr;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct http_hdr_ctx ctx;
struct ist hdr;
if (!smp->ctx.a[0]) { // first call, find the query string
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct htx_sl *sl;
if (!htx)
if (!smp->ctx.a[0]) { // first call, find the query string
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct buffer *temp;
int32_t pos;
if (IS_HTX_SMP(smp) || (smp->px->mode == PR_MODE_TCP)) {
/* HTX version */
- struct htx *htx = smp_prefetch_htx(smp, chn);
+ struct htx *htx = smp_prefetch_htx(smp, chn, 1);
struct http_hdr_ctx ctx;
struct htx_sl *sl;
struct ist path;