There's no need in for-loop, a single buffer is fed at a time.
qc = ngx_quic_get_connection(c);
ctx = ngx_quic_get_send_ctx(qc, qc->read_level);
- for (cl = ctx->crypto.chain; cl; cl = cl->next) {
- b = cl->buf;
-
- if (b->sync) {
- /* hole */
+ cl = ctx->crypto.chain;
- *data = NULL;
- *bytes_read = 0;
+ if (cl == NULL || cl->buf->sync) {
+ *data = NULL;
+ *bytes_read = 0;
- break;
- }
+ } else {
+ b = cl->buf;
*data = b->pos;
*bytes_read = b->last - b->pos;
-
- break;
}
- *data = NULL;
- *bytes_read = 0;
-
return 1;
}