]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: http-client: Notify applet has more data to deliver until the EOM
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 9 Jul 2025 13:20:41 +0000 (15:20 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 9 Jul 2025 14:27:24 +0000 (16:27 +0200)
When we leave the I/O handler with an unfinished request, we must report the
applet has more data to deliver. Otherwise, when the channel request buffer
is emptied, the http-client applet is not always woken up to forward the
remaining request data.

This issue was probably revealed by commit "BUG/MEDIUM: http-client: Don't
wake http-client applet if nothing was xferred". It is only an issue with
large POSTs, when the payload is streamed.

This patch must be backported as far as 2.6 with the commit above. But on
older versions, the applet API may differ. So be careful.

src/http_client.c

index 0adfb1d22fa60768cc8cf69efe700419fcc1303d..cffc5de7e2e4945560e45a1408dddab8262ac149 100644 (file)
@@ -567,9 +567,9 @@ void httpclient_applet_io_handler(struct appctx *appctx)
                                        se_fl_set(appctx->sedesc, SE_FL_EOI);
                                        break;
                                }
-                               else
-                                       appctx->st0 = HTTPCLIENT_S_REQ_BODY;
 
+                               applet_have_more_data(appctx);
+                               appctx->st0 = HTTPCLIENT_S_REQ_BODY;
                                goto out; /* we need to leave the IO handler once we wrote the request */
                                break;
 
@@ -642,6 +642,7 @@ void httpclient_applet_io_handler(struct appctx *appctx)
                                                break;
                                        }
 
+                                       applet_have_more_data(appctx);
                                        goto process_data; /* we need to leave the IO handler once we wrote the request */
                                }
                                break;