diff --git a/include/haproxy/mux_quic.h b/include/haproxy/mux_quic.h index bfdf4dd1c..8b2444ccc 100644 --- a/include/haproxy/mux_quic.h +++ b/include/haproxy/mux_quic.h @@ -21,7 +21,7 @@ void qcc_set_error(struct qcc *qcc, int err, int app); int _qcc_report_glitch(struct qcc *qcc, int inc); struct qcs *qcc_init_stream_local(struct qcc *qcc, int bidi); void qcs_send_metadata(struct qcs *qcs); -struct stconn *qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin); +int qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin); int qcs_is_close_local(struct qcs *qcs); int qcs_is_close_remote(struct qcs *qcs); diff --git a/src/h3.c b/src/h3.c index 9f7bb0206..48bf6d8de 100644 --- a/src/h3.c +++ b/src/h3.c @@ -915,7 +915,7 @@ static ssize_t h3_headers_to_htx(struct qcs *qcs, const struct buffer *buf, htx_to_buf(htx, &htx_buf); htx = NULL; - if (!qcs_attach_sc(qcs, &htx_buf, fin)) { + if (qcs_attach_sc(qcs, &htx_buf, fin)) { len = -1; goto out; } diff --git a/src/hq_interop.c b/src/hq_interop.c index 18e9e2ccc..1d7821fec 100644 --- a/src/hq_interop.c +++ b/src/hq_interop.c @@ -77,7 +77,7 @@ static ssize_t hq_interop_rcv_buf(struct qcs *qcs, struct buffer *b, int fin) htx->flags |= HTX_FL_EOM; htx_to_buf(htx, &htx_buf); - if (!qcs_attach_sc(qcs, &htx_buf, fin)) + if (qcs_attach_sc(qcs, &htx_buf, fin)) return -1; b_free(&htx_buf); diff --git a/src/mux_quic.c b/src/mux_quic.c index dac22af35..5ff006090 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -899,9 +899,9 @@ void qcs_send_metadata(struct qcs *qcs) * the first received request data. must be set if the whole request is * already received. * - * Returns the newly allocated instance on success or NULL on error. + * Returns 0 on success else a negative error code. */ -struct stconn *qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin) +int qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin) { struct qcc *qcc = qcs->qcc; struct session *sess = qcc->conn->owner; @@ -913,7 +913,7 @@ struct stconn *qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin) if (!sc_new_from_endp(qcs->sd, sess, buf)) { TRACE_DEVEL("leaving on error", QMUX_EV_STRM_RECV, qcc->conn, qcs); - return NULL; + return -1; } /* QC_SF_HREQ_RECV must be set once for a stream. Else, nb_hreq counter @@ -959,7 +959,7 @@ struct stconn *qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin) } TRACE_LEAVE(QMUX_EV_STRM_RECV, qcc->conn, qcs); - return qcs->sd->sc; + return 0; } /* Use this function for a stream which is not in stream tree. It