mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
MINOR: h3: add traces on h3_init_uni_stream() error paths
Complete traces on h3_init_uni_stream(). This ensures there is always a dedicated trace for each error paths. This should be backported up to 2.7.
This commit is contained in:
parent
447a38f387
commit
815c8ce210
18
src/h3.c
18
src/h3.c
@ -187,8 +187,9 @@ static ssize_t h3_init_uni_stream(struct h3c *h3c, struct qcs *qcs,
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case H3_UNI_S_T_CTRL:
|
case H3_UNI_S_T_CTRL:
|
||||||
if (h3c->flags & H3_CF_UNI_CTRL_SET) {
|
if (h3c->flags & H3_CF_UNI_CTRL_SET) {
|
||||||
|
TRACE_ERROR("duplicated control stream", H3_EV_H3S_NEW, qcs->qcc->conn, qcs);
|
||||||
qcc_emit_cc_app(qcs->qcc, H3_STREAM_CREATION_ERROR, 1);
|
qcc_emit_cc_app(qcs->qcc, H3_STREAM_CREATION_ERROR, 1);
|
||||||
return -1;
|
goto err;
|
||||||
}
|
}
|
||||||
h3c->flags |= H3_CF_UNI_CTRL_SET;
|
h3c->flags |= H3_CF_UNI_CTRL_SET;
|
||||||
h3s->type = H3S_T_CTRL;
|
h3s->type = H3S_T_CTRL;
|
||||||
@ -201,8 +202,9 @@ static ssize_t h3_init_uni_stream(struct h3c *h3c, struct qcs *qcs,
|
|||||||
|
|
||||||
case H3_UNI_S_T_QPACK_DEC:
|
case H3_UNI_S_T_QPACK_DEC:
|
||||||
if (h3c->flags & H3_CF_UNI_QPACK_DEC_SET) {
|
if (h3c->flags & H3_CF_UNI_QPACK_DEC_SET) {
|
||||||
|
TRACE_ERROR("duplicated qpack decoder stream", H3_EV_H3S_NEW, qcs->qcc->conn, qcs);
|
||||||
qcc_emit_cc_app(qcs->qcc, H3_STREAM_CREATION_ERROR, 1);
|
qcc_emit_cc_app(qcs->qcc, H3_STREAM_CREATION_ERROR, 1);
|
||||||
return -1;
|
goto err;
|
||||||
}
|
}
|
||||||
h3c->flags |= H3_CF_UNI_QPACK_DEC_SET;
|
h3c->flags |= H3_CF_UNI_QPACK_DEC_SET;
|
||||||
h3s->type = H3S_T_QPACK_DEC;
|
h3s->type = H3S_T_QPACK_DEC;
|
||||||
@ -211,8 +213,9 @@ static ssize_t h3_init_uni_stream(struct h3c *h3c, struct qcs *qcs,
|
|||||||
|
|
||||||
case H3_UNI_S_T_QPACK_ENC:
|
case H3_UNI_S_T_QPACK_ENC:
|
||||||
if (h3c->flags & H3_CF_UNI_QPACK_ENC_SET) {
|
if (h3c->flags & H3_CF_UNI_QPACK_ENC_SET) {
|
||||||
|
TRACE_ERROR("duplicated qpack encoder stream", H3_EV_H3S_NEW, qcs->qcc->conn, qcs);
|
||||||
qcc_emit_cc_app(qcs->qcc, H3_STREAM_CREATION_ERROR, 1);
|
qcc_emit_cc_app(qcs->qcc, H3_STREAM_CREATION_ERROR, 1);
|
||||||
return -1;
|
goto err;
|
||||||
}
|
}
|
||||||
h3c->flags |= H3_CF_UNI_QPACK_ENC_SET;
|
h3c->flags |= H3_CF_UNI_QPACK_ENC_SET;
|
||||||
h3s->type = H3S_T_QPACK_ENC;
|
h3s->type = H3S_T_QPACK_ENC;
|
||||||
@ -225,14 +228,19 @@ static ssize_t h3_init_uni_stream(struct h3c *h3c, struct qcs *qcs,
|
|||||||
* Implementations MUST [...] abort reading on unidirectional
|
* Implementations MUST [...] abort reading on unidirectional
|
||||||
* streams that have unknown or unsupported types.
|
* streams that have unknown or unsupported types.
|
||||||
*/
|
*/
|
||||||
|
TRACE_STATE("abort reading on unknown uni stream type", H3_EV_H3S_NEW, qcs->qcc->conn, qcs);
|
||||||
qcc_abort_stream_read(qcs);
|
qcc_abort_stream_read(qcs);
|
||||||
return -1;
|
goto err;
|
||||||
};
|
}
|
||||||
|
|
||||||
h3s->flags |= H3_SF_UNI_INIT;
|
h3s->flags |= H3_SF_UNI_INIT;
|
||||||
|
|
||||||
TRACE_LEAVE(H3_EV_H3S_NEW, qcs->qcc->conn, qcs);
|
TRACE_LEAVE(H3_EV_H3S_NEW, qcs->qcc->conn, qcs);
|
||||||
return len;
|
return len;
|
||||||
|
|
||||||
|
err:
|
||||||
|
TRACE_DEVEL("leaving on error", H3_EV_H3S_NEW, qcs->qcc->conn, qcs);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse a buffer <b> for a <qcs> uni-stream which does not contains H3 frames.
|
/* Parse a buffer <b> for a <qcs> uni-stream which does not contains H3 frames.
|
||||||
|
Loading…
Reference in New Issue
Block a user