Mercurial > hg > nginx-quic
comparison src/event/ngx_event_quic.c @ 8017:b0e74a54c98b quic
QUIC: consistent Stream ID logging format.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 28 Jul 2020 17:11:25 +0300 |
parents | c5324bb3a704 |
children | 12576ac9556d |
comparison
equal
deleted
inserted
replaced
8016:affb0245e291 | 8017:b0e74a54c98b |
---|---|
3122 | 3122 |
3123 sn = ngx_quic_find_stream(&qc->streams.tree, f->id); | 3123 sn = ngx_quic_find_stream(&qc->streams.tree, f->id); |
3124 | 3124 |
3125 if (sn == NULL) { | 3125 if (sn == NULL) { |
3126 ngx_log_error(NGX_LOG_INFO, c->log, 0, | 3126 ngx_log_error(NGX_LOG_INFO, c->log, 0, |
3127 "quic unknown stream id:%uL", f->id); | 3127 "quic unknown stream id:0x%xL", f->id); |
3128 return NGX_ERROR; | 3128 return NGX_ERROR; |
3129 } | 3129 } |
3130 | 3130 |
3131 b = sn->b; | 3131 b = sn->b; |
3132 n = sn->fs.received + (b->pos - b->start) + (b->end - b->last); | 3132 n = sn->fs.received + (b->pos - b->start) + (b->end - b->last); |
3139 frame->level = pkt->level; | 3139 frame->level = pkt->level; |
3140 frame->type = NGX_QUIC_FT_MAX_STREAM_DATA; | 3140 frame->type = NGX_QUIC_FT_MAX_STREAM_DATA; |
3141 frame->u.max_stream_data.id = f->id; | 3141 frame->u.max_stream_data.id = f->id; |
3142 frame->u.max_stream_data.limit = n; | 3142 frame->u.max_stream_data.limit = n; |
3143 | 3143 |
3144 ngx_sprintf(frame->info, "MAX_STREAM_DATA id:%d limit:%d level=%d", | 3144 ngx_sprintf(frame->info, "MAX_STREAM_DATA id:0x%xL limit:%d level=%d", |
3145 (int) frame->u.max_stream_data.id, | 3145 (int) frame->u.max_stream_data.id, |
3146 (int) frame->u.max_stream_data.limit, | 3146 (int) frame->u.max_stream_data.limit, |
3147 frame->level); | 3147 frame->level); |
3148 | 3148 |
3149 ngx_quic_queue_frame(c->quic, frame); | 3149 ngx_quic_queue_frame(c->quic, frame); |
3171 } | 3171 } |
3172 | 3172 |
3173 sn = ngx_quic_find_stream(&qc->streams.tree, f->id); | 3173 sn = ngx_quic_find_stream(&qc->streams.tree, f->id); |
3174 | 3174 |
3175 if (sn == NULL) { | 3175 if (sn == NULL) { |
3176 ngx_log_error(NGX_LOG_INFO, c->log, 0, "unknown stream id:%uL", f->id); | 3176 ngx_log_error(NGX_LOG_INFO, c->log, 0, |
3177 "unknown stream id:0x%xL", f->id); | |
3177 | 3178 |
3178 if (f->id & NGX_QUIC_STREAM_SERVER_INITIATED) { | 3179 if (f->id & NGX_QUIC_STREAM_SERVER_INITIATED) { |
3179 qc->error = NGX_QUIC_ERR_STREAM_STATE_ERROR; | 3180 qc->error = NGX_QUIC_ERR_STREAM_STATE_ERROR; |
3180 } | 3181 } |
3181 | 3182 |
3784 | 3785 |
3785 id = (qc->streams.server_streams_bidi << 2) | 3786 id = (qc->streams.server_streams_bidi << 2) |
3786 | NGX_QUIC_STREAM_SERVER_INITIATED; | 3787 | NGX_QUIC_STREAM_SERVER_INITIATED; |
3787 | 3788 |
3788 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, | 3789 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, |
3789 "quic creating server bidi stream %uL/%uL id:%uL", | 3790 "quic creating server bidi stream %uL/%uL id:0x%xL", |
3790 qc->streams.server_streams_bidi, | 3791 qc->streams.server_streams_bidi, |
3791 qc->streams.server_max_streams_bidi, id); | 3792 qc->streams.server_max_streams_bidi, id); |
3792 | 3793 |
3793 qc->streams.server_streams_bidi++; | 3794 qc->streams.server_streams_bidi++; |
3794 rcvbuf_size = qc->tp.initial_max_stream_data_bidi_local; | 3795 rcvbuf_size = qc->tp.initial_max_stream_data_bidi_local; |
3806 id = (qc->streams.server_streams_uni << 2) | 3807 id = (qc->streams.server_streams_uni << 2) |
3807 | NGX_QUIC_STREAM_SERVER_INITIATED | 3808 | NGX_QUIC_STREAM_SERVER_INITIATED |
3808 | NGX_QUIC_STREAM_UNIDIRECTIONAL; | 3809 | NGX_QUIC_STREAM_UNIDIRECTIONAL; |
3809 | 3810 |
3810 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, | 3811 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, |
3811 "quic creating server uni stream %uL/%uL id:%uL", | 3812 "quic creating server uni stream %uL/%uL id:0x%xL", |
3812 qc->streams.server_streams_uni, | 3813 qc->streams.server_streams_uni, |
3813 qc->streams.server_max_streams_uni, id); | 3814 qc->streams.server_max_streams_uni, id); |
3814 | 3815 |
3815 qc->streams.server_streams_uni++; | 3816 qc->streams.server_streams_uni++; |
3816 rcvbuf_size = 0; | 3817 rcvbuf_size = 0; |
3884 ngx_quic_stream_t *sn; | 3885 ngx_quic_stream_t *sn; |
3885 ngx_pool_cleanup_t *cln; | 3886 ngx_pool_cleanup_t *cln; |
3886 ngx_quic_connection_t *qc; | 3887 ngx_quic_connection_t *qc; |
3887 | 3888 |
3888 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, | 3889 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, |
3889 "quic stream id 0x%uL create", id); | 3890 "quic stream id 0x%xL create", id); |
3890 | 3891 |
3891 qc = c->quic; | 3892 qc = c->quic; |
3892 | 3893 |
3893 pool = ngx_create_pool(NGX_DEFAULT_POOL_SIZE, c->log); | 3894 pool = ngx_create_pool(NGX_DEFAULT_POOL_SIZE, c->log); |
3894 if (pool == NULL) { | 3895 if (pool == NULL) { |
4042 frame->type = NGX_QUIC_FT_MAX_STREAM_DATA; | 4043 frame->type = NGX_QUIC_FT_MAX_STREAM_DATA; |
4043 frame->u.max_stream_data.id = qs->id; | 4044 frame->u.max_stream_data.id = qs->id; |
4044 frame->u.max_stream_data.limit = qs->fs.received + (b->pos - b->start) | 4045 frame->u.max_stream_data.limit = qs->fs.received + (b->pos - b->start) |
4045 + (b->end - b->last); | 4046 + (b->end - b->last); |
4046 | 4047 |
4047 ngx_sprintf(frame->info, "MAX_STREAM_DATA id:%d limit:%d l=%d on recv", | 4048 ngx_sprintf(frame->info, |
4049 "MAX_STREAM_DATA id:0x%xL limit:%d l=%d on recv", | |
4048 (int) frame->u.max_stream_data.id, | 4050 (int) frame->u.max_stream_data.id, |
4049 (int) frame->u.max_stream_data.limit, | 4051 (int) frame->u.max_stream_data.limit, |
4050 frame->level); | 4052 frame->level); |
4051 | 4053 |
4052 ngx_quic_queue_frame(pc->quic, frame); | 4054 ngx_quic_queue_frame(pc->quic, frame); |