char *fin);
size_t qcs_http_reset_buf(struct qcs *qcs, struct buffer *buf, size_t count);
-void qcs_http_handle_standalone_fin(struct qcs *qcs);
-
#endif /* USE_QUIC */
#endif /* _HAPROXY_MUX_QUIC_HTTP_H */
}
if (!b_data(b) && fin && quic_stream_is_bidi(qcs->id)) {
+ struct buffer *appbuf;
+ struct htx *htx;
+
TRACE_PROTO("received FIN without data", H3_EV_RX_FRAME, qcs->qcc->conn, qcs);
- qcs_http_handle_standalone_fin(qcs);
+ appbuf = qc_get_buf(qcs, &qcs->rx.app_buf);
+ BUG_ON(!appbuf);
+
+ htx = htx_from_buf(appbuf);
+ if (!htx_set_eom(htx)) {
+ TRACE_ERROR("cannot set EOM", H3_EV_RX_FRAME, qcs->qcc->conn, qcs);
+ h3c->err = H3_INTERNAL_ERROR;
+ }
+ htx_to_buf(htx, appbuf);
goto done;
}
size_t data = b_data(b);
if (!data && fin) {
+ struct buffer *appbuf;
+ struct htx *htx;
+
/* FIN is notified with an empty STREAM frame. */
BUG_ON(!qcs->sd); /* sd must already be attached here */
- qcs_http_handle_standalone_fin(qcs);
+
+ if (!(appbuf = qc_get_buf(qcs, &qcs->rx.app_buf)))
+ return -1;
+
+ htx = htx_from_buf(appbuf);
+ if (!htx_set_eom(htx))
+ return -1;
+ htx_to_buf(htx, appbuf);
+
return 0;
}
return count;
}
-
-/* Utility function which can be used by app layer an empty STREAM frame is
- * received with FIN bit set for <qcs> stream. It will ensure that HTX EOM is
- * properly inserted in <qcs> app_buf.
- */
-void qcs_http_handle_standalone_fin(struct qcs *qcs)
-{
- struct buffer *appbuf;
- struct htx *htx = NULL;
-
- appbuf = qc_get_buf(qcs, &qcs->rx.app_buf);
- BUG_ON(!appbuf);
-
- htx = htx_from_buf(appbuf);
- if (htx_is_empty(htx)) {
- if (!htx_add_endof(htx, HTX_BLK_EOT)) {
- ABORT_NOW(); /* cannot happen for empty HTX message. */
- }
- }
- htx->flags |= HTX_FL_EOM;
- htx_to_buf(htx, appbuf);
-}