/* fall through */
case PROMEX_ST_DONE:
- /* no more data are expected. Don't add TLR because mux-h1 will take care of it */
- res_htx->flags |= HTX_FL_EOM;
+ /* no more data are expected. If the response buffer is
+ * empty, be sure to add something (EOT block in this
+ * case) to have something to send. It is important to
+ * be sure the EOM flags will be handled by the
+ * endpoint.
+ */
+ if (htx_is_empty(res_htx)) {
+ if (!htx_add_endof(res_htx, HTX_BLK_EOT)) {
+ si_rx_room_blk(si);
+ goto out;
+ }
+ channel_add_input(res, 1);
+ }
+ res_htx->flags |= HTX_FL_EOM;
si->cs->flags |= CS_FL_EOI;
res->flags |= CF_EOI;
appctx->st0 = PROMEX_ST_END;