comparison src/event/quic/ngx_event_quic.c @ 8692:0697294f79a4 quic

QUIC: removed redundant "app" flag from ngx_quic_close_frame_t. The flag was introduced to create type-aware CONNECTION_CLOSE frames, and now is replaced with frame type information, directly accessible. Notably, this fixes type logging for received frames in b3d9e57d0f62.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 03 Feb 2021 12:39:41 +0300
parents a346905c359f
children 3956bbf91002
comparison
equal deleted inserted replaced
8691:250974f8f8e7 8692:0697294f79a4
520 break; 520 break;
521 521
522 case NGX_QUIC_FT_CONNECTION_CLOSE: 522 case NGX_QUIC_FT_CONNECTION_CLOSE:
523 case NGX_QUIC_FT_CONNECTION_CLOSE_APP: 523 case NGX_QUIC_FT_CONNECTION_CLOSE_APP:
524 p = ngx_slprintf(p, last, "CONNECTION_CLOSE%s err:%ui", 524 p = ngx_slprintf(p, last, "CONNECTION_CLOSE%s err:%ui",
525 f->u.close.app ? "_APP" : "", f->u.close.error_code); 525 f->type == NGX_QUIC_FT_CONNECTION_CLOSE ? "" : "_APP",
526 f->u.close.error_code);
526 527
527 if (f->u.close.reason.len) { 528 if (f->u.close.reason.len) {
528 p = ngx_slprintf(p, last, " %V", &f->u.close.reason); 529 p = ngx_slprintf(p, last, " %V", &f->u.close.reason);
529 } 530 }
530 531
3249 if (frame == NULL) { 3250 if (frame == NULL) {
3250 return NGX_ERROR; 3251 return NGX_ERROR;
3251 } 3252 }
3252 3253
3253 frame->level = qc->error_level; 3254 frame->level = qc->error_level;
3254 frame->type = NGX_QUIC_FT_CONNECTION_CLOSE; 3255 frame->type = qc->error_app ? NGX_QUIC_FT_CONNECTION_CLOSE_APP
3256 : NGX_QUIC_FT_CONNECTION_CLOSE;
3255 frame->u.close.error_code = qc->error; 3257 frame->u.close.error_code = qc->error;
3256 frame->u.close.frame_type = qc->error_ftype; 3258 frame->u.close.frame_type = qc->error_ftype;
3257 frame->u.close.app = qc->error_app;
3258 3259
3259 if (qc->error_reason) { 3260 if (qc->error_reason) {
3260 frame->u.close.reason.len = ngx_strlen(qc->error_reason); 3261 frame->u.close.reason.len = ngx_strlen(qc->error_reason);
3261 frame->u.close.reason.data = (u_char *) qc->error_reason; 3262 frame->u.close.reason.data = (u_char *) qc->error_reason;
3262 } 3263 }