return hlen;
}
-/* Decode <qcs> remotely initiated bidi-stream */
+/* Decode <qcs> remotely initiated bidi-stream.
+ * Returns <0 on error else 0.
+ */
static int h3_decode_qcs(struct qcs *qcs, void *ctx)
{
struct buffer *rxbuf = &qcs->rx.buf;
flags |= HTX_SL_F_VER_11;
sl = htx_add_stline(htx, HTX_BLK_REQ_SL, flags, meth, path, ist("HTTP/3.0"));
+ if (!sl)
+ goto fail;
sl->flags |= HTX_SL_F_BODYLESS;
sl->info.req.meth = find_http_meth(meth.ptr, meth.len);
BUG_ON(sl->info.req.meth == HTTP_METH_OTHER);
b_del(rxbuf, flen);
}
- return 1;
+ return 0;
+
+ fail:
+ return -1;
}
/* Parse a SETTINGS frame which must not be truncated with <flen> as length from
goto store_frm;
ret = qc_strm_cpy(&strm->rx.buf, strm_frm);
- if (ret && qc->qcc->app_ops->decode_qcs(strm, qc->qcc->ctx) == -1) {
+ if (ret && qc->qcc->app_ops->decode_qcs(strm, qc->qcc->ctx) < 0) {
TRACE_PROTO("Decoding error", QUIC_EV_CONN_PSTRM);
return 0;
}