void qcc_emit_cc_app(struct qcc *qcc, int err, int immediate);
void qcc_reset_stream(struct qcs *qcs, int err);
-void qcc_send_stream(struct qcs *qcs);
+void qcc_send_stream(struct qcs *qcs, int urg);
void qcc_abort_stream_read(struct qcs *qcs);
int qcc_recv(struct qcc *qcc, uint64_t id, uint64_t len, uint64_t offset,
char fin, char *data);
ret = b_force_xfer(res, &pos, b_data(&pos));
if (ret > 0) {
/* Register qcs for sending before other streams. */
- qcc_send_stream(qcs);
+ qcc_send_stream(qcs, 1);
h3c->flags |= H3_CF_SETTINGS_SENT;
}
tasklet_wakeup(qcc->wait_event.tasklet);
}
-/* Register <qcs> stream for emission of STREAM, STOP_SENDING or RESET_STREAM. */
-void qcc_send_stream(struct qcs *qcs)
+/* Register <qcs> stream for emission of STREAM, STOP_SENDING or RESET_STREAM.
+ * Set <urg> to 1 if stream content should be treated in priority compared to
+ * other streams.
+ */
+void qcc_send_stream(struct qcs *qcs, int urg)
{
struct qcc *qcc = qcs->qcc;
/* Cannot send if already closed. */
BUG_ON(qcs_is_close_local(qcs));
- if (!LIST_INLIST(&qcs->el_send))
- LIST_APPEND(&qcs->qcc->send_list, &qcs->el_send);
+ if (urg) {
+ LIST_DEL_INIT(&qcs->el_send);
+ LIST_INSERT(&qcc->send_list, &qcs->el_send);
+ }
+ else {
+ if (!LIST_INLIST(&qcs->el_send))
+ LIST_APPEND(&qcs->qcc->send_list, &qcs->el_send);
+ }
TRACE_LEAVE(QMUX_EV_QCS_SEND, qcc->conn, qcs);
}
qcs->flags |= QC_SF_FIN_STREAM;
if (ret || fin) {
- qcc_send_stream(qcs);
+ qcc_send_stream(qcs, 0);
if (!(qcs->qcc->wait_event.events & SUB_RETRY_SEND))
tasklet_wakeup(qcs->qcc->wait_event.tasklet);
}