]> git.kaiwu.me - haproxy.git/commitdiff
CLEANUP: applet/http-client: Don't needlessly copy HTX flags after htx_xfer()
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Jul 2026 13:33:22 +0000 (15:33 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 2 Jul 2026 15:03:54 +0000 (17:03 +0200)
htx_xfer() function already takes care to copy HTX flags (EOM and
errors). So it is useless to do so in caller functions.

src/applet.c
src/http_client.c

index db30df612011134213dd3c6d32f59a4a91a07835..a6e6a4e78c3202e3b7f5c0a70bb5b72e28932597 100644 (file)
@@ -512,10 +512,6 @@ size_t appctx_htx_rcv_buf(struct appctx *appctx, struct buffer *buf, size_t coun
        }
 
        htx_xfer(buf_htx, appctx_htx, count, HTX_XFER_DEFAULT);
-       buf_htx->flags |= (appctx_htx->flags & (HTX_FL_PARSING_ERROR|HTX_FL_PROCESSING_ERROR));
-       if (htx_is_empty(appctx_htx)) {
-               buf_htx->flags |= (appctx_htx->flags & HTX_FL_EOM);
-       }
        htx_to_buf(buf_htx, buf);
        htx_to_buf(appctx_htx, &appctx->outbuf);
        ret -= appctx_htx->data;
@@ -607,10 +603,6 @@ size_t appctx_htx_snd_buf(struct appctx *appctx, struct buffer *buf, size_t coun
        }
 
        htx_xfer(appctx_htx, buf_htx, count, HTX_XFER_NO_METADATA);
-       if (htx_is_empty(buf_htx)) {
-               appctx_htx->flags |= (buf_htx->flags & HTX_FL_EOM);
-       }
-
        htx_to_buf(appctx_htx, &appctx->inbuf);
        htx_to_buf(buf_htx, buf);
        ret -= buf_htx->data;
index 1571722429a37b740b3b924b0655f33c2e692e96..3bdbb80803a7778ca9281a8645a4bca50f9131a2 100644 (file)
@@ -621,11 +621,6 @@ void httpclient_applet_io_handler(struct appctx *appctx)
                                                        applet_have_more_data(appctx);
                                                        goto out;
                                                }
-
-                                               /* we must copy the EOM if we empty the buffer */
-                                               if (htx_is_empty(hc_htx)) {
-                                                       htx->flags |= (hc_htx->flags & HTX_FL_EOM);
-                                               }
                                                htx_to_buf(htx, outbuf);
                                                htx_to_buf(hc_htx, &hc->req.buf);
                                        }