} ngx_quic_conf_t;
-typedef struct {
- uint64_t sent;
- uint64_t received;
- ngx_queue_t frames; /* reorder queue */
- size_t total; /* size of buffered data */
-} ngx_quic_frames_stream_t;
-
+typedef struct ngx_quic_frames_stream_s ngx_quic_frames_stream_t;
struct ngx_quic_stream_s {
ngx_rbtree_node_t node;
uint64_t acked;
uint64_t send_max_data;
ngx_buf_t *b;
- ngx_quic_frames_stream_t fs;
+ ngx_quic_frames_stream_t *fs;
ngx_uint_t cancelable; /* unsigned cancelable:1; */
};
return NULL;
}
- ngx_queue_init(&sn->fs.frames);
+ sn->fs = ngx_pcalloc(pool, sizeof(ngx_quic_frames_stream_t));
+ if (sn->fs == NULL) {
+ ngx_destroy_pool(pool);
+ return NULL;
+ }
+
+ ngx_queue_init(&sn->fs->frames);
log = ngx_palloc(pool, sizeof(ngx_log_t));
if (log == NULL) {
frame->level = ssl_encryption_application;
frame->type = NGX_QUIC_FT_MAX_STREAM_DATA;
frame->u.max_stream_data.id = qs->id;
- frame->u.max_stream_data.limit = qs->fs.received + (b->pos - b->start)
+ frame->u.max_stream_data.limit = qs->fs->received + (b->pos - b->start)
+ (b->end - b->last);
ngx_quic_queue_frame(qc, frame);
"quic stream id:0x%xL cleanup", qs->id);
ngx_rbtree_delete(&qc->streams.tree, &qs->node);
- ngx_quic_free_frames(pc, &qs->fs.frames);
+ ngx_quic_free_frames(pc, &qs->fs->frames);
if (qc->closing) {
/* schedule handler call to continue ngx_quic_close_connection() */
}
sc = sn->c;
- fs = &sn->fs;
+ fs = sn->fs;
b = sn->b;
window = b->end - b->last;
return NGX_OK;
}
- fs = &sn->fs;
+ fs = sn->fs;
b = sn->b;
window = (b->pos - b->start) + (b->end - b->last);
} else {
b = sn->b;
- n = sn->fs.received + (b->pos - b->start) + (b->end - b->last);
+ n = sn->fs->received + (b->pos - b->start) + (b->end - b->last);
}
frame = ngx_quic_alloc_frame(c);