int start; /* base timestamp for http-request timeout */
};
+/* Used as qcc_app_ops.close callback argument. */
+enum qcc_app_ops_close_side {
+ QCC_APP_OPS_CLOSE_SIDE_RD, /* Read channel closed (RESET_STREAM received). */
+ QCC_APP_OPS_CLOSE_SIDE_WR /* Write channel closed (STOP_SENDING received). */
+};
+
/* QUIC application layer operations */
struct qcc_app_ops {
int (*init)(struct qcc *qcc);
int (*attach)(struct qcs *qcs, void *conn_ctx);
ssize_t (*decode_qcs)(struct qcs *qcs, struct buffer *b, int fin);
size_t (*snd_buf)(struct qcs *qcs, struct htx *htx, size_t count);
+ int (*close)(struct qcs *qcs, enum qcc_app_ops_close_side side);
void (*detach)(struct qcs *qcs);
int (*finalize)(void *ctx);
void (*shutdown)(void *ctx); /* Close a connection. */
return total;
}
+/* Notify about a closure on <qcs> stream requested by the remote peer.
+ *
+ * Stream channel <side> is explained relative to our endpoint : WR for
+ * STOP_SENDING or RD for RESET_STREAM reception. Callback decode_qcs() is used
+ * instead for closure performed using a STREAM frame with FIN bit.
+ *
+ * The main objective of this function is to check if closure is valid
+ * according to HTTP/3 specification.
+ *
+ * Returns 0 on success else non-zero. A CONNECTION_CLOSE is generated on
+ * error.
+ */
+static int h3_close(struct qcs *qcs, enum qcc_app_ops_close_side side)
+{
+ /* TODO */
+ return 0;
+}
+
static int h3_attach(struct qcs *qcs, void *conn_ctx)
{
struct h3s *h3s;
.attach = h3_attach,
.decode_qcs = h3_decode_qcs,
.snd_buf = h3_snd_buf,
+ .close = h3_close,
.detach = h3_detach,
.finalize = h3_finalize,
.shutdown = h3_shutdown,