struct list list; /* element for qc_stream_desc list */
};
+#define QC_SD_FL_RELEASE 0x00000001 /* set when MUX has finished to use this stream */
+
/* QUIC STREAM descriptor.
*
* This structure is the low-level counterpart of the QUIC STREAM at the MUX
uint64_t ack_offset; /* last acknowledged offset */
struct eb_root acked_frms; /* ACK frames tree for non-contiguous ACK ranges */
- int release; /* set to 1 when the MUX has finished to use this stream */
+ int flags; /* QC_SD_FL_* values */
void *ctx; /* MUX specific context */
};
/* all streams attached to the quic-conn are released, so
* qc_stream_desc_free will liberate the stream instance.
*/
- BUG_ON(!stream->release);
+ BUG_ON(!(stream->flags & QC_SD_FL_RELEASE));
qc_stream_desc_free(stream, 1);
}
stream->acked_frms = EB_ROOT;
stream->ack_offset = 0;
- stream->release = 0;
+ stream->flags = 0;
stream->ctx = ctx;
return stream;
return;
/* A stream can be released only one time. */
- BUG_ON(stream->release);
+ BUG_ON(stream->flags & QC_SD_FL_RELEASE);
- stream->release = 1;
+ stream->flags |= QC_SD_FL_RELEASE;
stream->ctx = NULL;
if (stream->buf) {
qc_stream_buf_free(s, &stream_buf);
/* Free stream instance if already released and no buffers left. */
- if (s->release && LIST_ISEMPTY(&s->buf_list)) {
+ if ((s->flags & QC_SD_FL_RELEASE) && LIST_ISEMPTY(&s->buf_list)) {
qc_stream_desc_free(s, 0);
*stream = NULL;
}
unsigned int free_count = 0;
/* This function only deals with released streams. */
- BUG_ON(!stream->release);
+ BUG_ON(!(stream->flags & QC_SD_FL_RELEASE));
/* free remaining stream buffers */
list_for_each_entry_safe(buf, buf_back, &stream->buf_list, list) {