]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http_fetch/htx: Use stream flags instead of px mode in smp_prefetch_htx
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Apr 2019 08:12:42 +0000 (10:12 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 12 Apr 2019 20:06:53 +0000 (22:06 +0200)
In the function smp_prefetch_htx(), we must know if data in the channel's buffer
are structured or not. Before the proxy mode was tested. Now we test if the
stream is an HTX stream or not. If yes, we know the HTX is used to structure
data in the channel's buffer.

src/http_fetch.c

index 51f2ef13f22333d35045c49e5d39912311ce1bfa..d720b374d8f3720ec60acfad5de13ac52c99c7cd 100644 (file)
@@ -169,7 +169,6 @@ static int get_http_auth(struct sample *smp)
  */
 struct htx *smp_prefetch_htx(struct sample *smp, const struct arg *args)
 {
-       struct proxy *px = smp->px;
        struct stream *s = smp->strm;
        unsigned int opt = smp->opt;
        struct http_txn *txn = NULL;
@@ -190,7 +189,7 @@ struct htx *smp_prefetch_htx(struct sample *smp, const struct arg *args)
                txn = s->txn;
        }
 
-       if (px->mode == PR_MODE_HTTP) {
+       if (IS_HTX_STRM(s)) {
                if ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) {
                        htx = htxbuf(&s->req.buf);
                        if (htx_is_empty(htx) || htx_get_tail_type(htx) < HTX_BLK_EOH) {
@@ -221,7 +220,7 @@ struct htx *smp_prefetch_htx(struct sample *smp, const struct arg *args)
                        }
                }
        }
-       else { /* PR_MODE_TCP */
+       else { /* RAW mode */
                if ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) {
                        struct buffer *buf;
                        struct h1m h1m;