#define QC_SF_NONE 0x00000000
#define QC_SF_FIN_STREAM 0x00000001 // FIN bit must be set for last frame of the stream
+#define QC_SF_BLK_MROOM 0x00000002 // app layer is blocked waiting for room in the qcs.tx.buf
struct qcs {
struct qcc *qcc;
b_slow_realign(res, trash.area, b_data(res));
}
- /* not enough room for headers and at least one data byte, block the
- * stream
+ /* Not enough room for headers and at least one data byte, block the
+ * stream. It is expected that the conn-stream layer will subscribe on
+ * SEND.
*/
- if (b_size(&outbuf) <= hsize)
- ABORT_NOW();
+ if (b_size(&outbuf) <= hsize) {
+ qcs->flags |= QC_SF_BLK_MROOM;
+ goto end;
+ }
if (b_size(&outbuf) < hsize + fsize)
fsize = b_size(&outbuf) - hsize;
htx = htx_from_buf(buf);
- while (count && !htx_is_empty(htx)) {
+ while (count && !htx_is_empty(htx) && !(qcs->flags & QC_SF_BLK_MROOM)) {
idx = htx_get_head(htx);
blk = htx_get_blk(htx, idx);
btype = htx_get_blk_type(blk);
res = mux_get_buf(qcs);
outbuf = b_make(b_tail(res), b_contig_space(res), 0, 0);
- while (count && !htx_is_empty(htx)) {
+ while (count && !htx_is_empty(htx) && !(qcs->flags & QC_SF_BLK_MROOM)) {
/* Not implemented : QUIC on backend side */
idx = htx_get_head(htx);
blk = htx_get_blk(htx, idx);