This reverts commit
2aed0c9bea4a61c0c58a1fc89f4fa98647fe0528.
This fix introduces a major regression as emitting trailers without EOT
is not supported by htx_xfer(). A BUG_ON() in this function is triggered
if rcv_buf runs between the trailers parsing and the FIN reception.
This may reveals deeper limitation which may requires a different
approach for the original issue. A revert is considered the most viable
solution for now until a decision is made the most viable as the
original issue is not a major one.
Several conflits were fixed as code changed multiple times in
H3/hq-interop due to other minor fixes introduced since the bug
introuction.
The faulty patch was not yet picked in stable releases as it was under
observation. As such, it must now be skipped and thus this revert is
only relevant for the current dev tree.
size_t qcs_http_rcv_buf(struct qcs *qcs, struct buffer *buf, size_t count,
char *fin);
-int qcs_http_handle_standalone_fin(struct qcs *qcs, int force_eot);
+int qcs_http_handle_standalone_fin(struct qcs *qcs);
size_t qcs_http_snd_buf(struct qcs *qcs, struct buffer *buf, size_t count,
char *fin);
goto out;
}
- prs_status = http_trailers_to_htx(list, fin, htx, (qcs->qcc->flags & QC_CF_IS_BACK) ? HTTP_PF_DIR_RES : 0);
+ prs_status = http_trailers_to_htx(list, 1, htx, (qcs->qcc->flags & QC_CF_IS_BACK) ? HTTP_PF_DIR_RES : 0);
switch (prs_status) {
case HTTP_PRS_SUCCESS:
break;
goto done;
}
- if (qcs_http_handle_standalone_fin(qcs, h3s->st_req == H3S_ST_REQ_TRAILERS)) {
+ if (qcs_http_handle_standalone_fin(qcs)) {
TRACE_ERROR("cannot set EOM", H3_EV_RX_FRAME, qcs->qcc->conn, qcs);
qcc_set_error(qcs->qcc, H3_ERR_INTERNAL_ERROR, 1,
muxc_tevt_type_internal_err);
}
/* Reuse wrapper function to easily set EOM on HTX message. */
- if (qcs_http_handle_standalone_fin(qcs, h3s->st_req == H3S_ST_REQ_TRAILERS)) {
+ if (qcs_http_handle_standalone_fin(qcs)) {
TRACE_ERROR("cannot set EOM", H3_EV_RX_FRAME, qcs->qcc->conn, qcs);
qcc_set_error(qcs->qcc, H3_ERR_INTERNAL_ERROR, 1,
muxc_tevt_type_internal_err);
/* Drain any data after the request and handle FIN if present,
* including the case where it is set without any payload.
*/
- if (fin && qcs_http_handle_standalone_fin(qcs, 0))
+ if (fin && qcs_http_handle_standalone_fin(qcs))
return -1;
return data;
}
if (!to_copy) {
if (fin) {
- if (qcs_http_handle_standalone_fin(qcs, 0)) {
+ if (qcs_http_handle_standalone_fin(qcs)) {
htx_to_buf(htx, htx_buf);
return -1;
}
return ret;
}
-/* Add EOM flag on input buffer for <qcs> instance. If <force_eot> is set, EOT
- * is manually inserted. This is necessary if HTX message contains not yet
- * finalized trailers blocks.
- *
+/* Add EOM flag on input buffer for <qcs> instance.
* Returns 0 on success else non zero on internal error.
*/
-int qcs_http_handle_standalone_fin(struct qcs *qcs, int force_eot)
+int qcs_http_handle_standalone_fin(struct qcs *qcs)
{
struct buffer *appbuf;
struct htx *htx = NULL;
goto err;
htx = htx_from_buf(appbuf);
- if (force_eot && !htx_add_endof(htx, HTX_BLK_EOT))
- goto err;
-
if (!htx_set_eom(htx))
goto err;