Mercurial > hg > nginx-quic
comparison src/event/quic/ngx_event_quic.c @ 8295:d4e02b3b734f quic
QUIC: fixed indentation.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 15 Feb 2021 14:54:28 +0300 |
parents | ba9e34c03968 |
children | d710c457171c |
comparison
equal
deleted
inserted
replaced
8294:ba9e34c03968 | 8295:d4e02b3b734f |
---|---|
540 | 540 |
541 if (f->type == NGX_QUIC_FT_CONNECTION_CLOSE) { | 541 if (f->type == NGX_QUIC_FT_CONNECTION_CLOSE) { |
542 p = ngx_slprintf(p, last, " ft:%ui", f->u.close.frame_type); | 542 p = ngx_slprintf(p, last, " ft:%ui", f->u.close.frame_type); |
543 } | 543 } |
544 | 544 |
545 | |
546 break; | 545 break; |
547 | 546 |
548 case NGX_QUIC_FT_STREAM0: | 547 case NGX_QUIC_FT_STREAM0: |
549 case NGX_QUIC_FT_STREAM1: | 548 case NGX_QUIC_FT_STREAM1: |
550 case NGX_QUIC_FT_STREAM2: | 549 case NGX_QUIC_FT_STREAM2: |
587 p = ngx_slprintf(p, last, "MAX_DATA max_data:%uL on recv", | 586 p = ngx_slprintf(p, last, "MAX_DATA max_data:%uL on recv", |
588 f->u.max_data.max_data); | 587 f->u.max_data.max_data); |
589 break; | 588 break; |
590 | 589 |
591 case NGX_QUIC_FT_RESET_STREAM: | 590 case NGX_QUIC_FT_RESET_STREAM: |
592 p = ngx_slprintf(p, last, "RESET_STREAM" | 591 p = ngx_slprintf(p, last, "RESET_STREAM" |
593 " id:0x%xL error_code:0x%xL final_size:0x%xL", | 592 " id:0x%xL error_code:0x%xL final_size:0x%xL", |
594 f->u.reset_stream.id, f->u.reset_stream.error_code, | 593 f->u.reset_stream.id, f->u.reset_stream.error_code, |
595 f->u.reset_stream.final_size); | 594 f->u.reset_stream.final_size); |
596 break; | 595 break; |
597 | 596 |
1010 return NGX_ERROR; | 1009 return NGX_ERROR; |
1011 | 1010 |
1012 } else if (ctp->max_udp_payload_size > ngx_quic_max_udp_payload(c)) { | 1011 } else if (ctp->max_udp_payload_size > ngx_quic_max_udp_payload(c)) { |
1013 ctp->max_udp_payload_size = ngx_quic_max_udp_payload(c); | 1012 ctp->max_udp_payload_size = ngx_quic_max_udp_payload(c); |
1014 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, | 1013 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, |
1015 "quic client maximum packet size truncated"); | 1014 "quic client maximum packet size truncated"); |
1016 } | 1015 } |
1017 | 1016 |
1018 if (ctp->active_connection_id_limit < 2) { | 1017 if (ctp->active_connection_id_limit < 2) { |
1019 qc->error = NGX_QUIC_ERR_TRANSPORT_PARAMETER_ERROR; | 1018 qc->error = NGX_QUIC_ERR_TRANSPORT_PARAMETER_ERROR; |
1020 qc->error_reason = "invalid active_connection_id_limit"; | 1019 qc->error_reason = "invalid active_connection_id_limit"; |
1516 if (len == NGX_ERROR) { | 1515 if (len == NGX_ERROR) { |
1517 return NGX_ERROR; | 1516 return NGX_ERROR; |
1518 } | 1517 } |
1519 | 1518 |
1520 ngx_log_debug(NGX_LOG_DEBUG_EVENT, c->log, 0, | 1519 ngx_log_debug(NGX_LOG_DEBUG_EVENT, c->log, 0, |
1521 "quic retry packet sent to %xV", &pkt.dcid); | 1520 "quic retry packet sent to %xV", &pkt.dcid); |
1522 | 1521 |
1523 /* | 1522 /* |
1524 * quic-transport 17.2.5.1: A server MUST NOT send more than one Retry | 1523 * quic-transport 17.2.5.1: A server MUST NOT send more than one Retry |
1525 * packet in response to a single UDP datagram. | 1524 * packet in response to a single UDP datagram. |
1526 * NGX_DONE will stop quic_input() from processing further | 1525 * NGX_DONE will stop quic_input() from processing further |
1965 qc = ngx_quic_get_connection(c); | 1964 qc = ngx_quic_get_connection(c); |
1966 | 1965 |
1967 if (qc == NULL) { | 1966 if (qc == NULL) { |
1968 if (rc == NGX_ERROR) { | 1967 if (rc == NGX_ERROR) { |
1969 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, | 1968 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, |
1970 "quic close connection early error"); | 1969 "quic close connection early error"); |
1971 } | 1970 } |
1972 | 1971 |
1973 } else if (ngx_quic_close_quic(c, rc) == NGX_AGAIN) { | 1972 } else if (ngx_quic_close_quic(c, rc) == NGX_AGAIN) { |
1974 return; | 1973 return; |
1975 } | 1974 } |
2038 | 2037 |
2039 qc->error_level = c->ssl ? SSL_quic_read_level(c->ssl->connection) | 2038 qc->error_level = c->ssl ? SSL_quic_read_level(c->ssl->connection) |
2040 : ssl_encryption_initial; | 2039 : ssl_encryption_initial; |
2041 | 2040 |
2042 if (rc == NGX_OK) { | 2041 if (rc == NGX_OK) { |
2043 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, | 2042 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, |
2044 "quic immediate close drain:%d", | 2043 "quic immediate close drain:%d", |
2045 qc->draining); | 2044 qc->draining); |
2046 | 2045 |
2047 qc->close.log = c->log; | 2046 qc->close.log = c->log; |
2048 qc->close.data = c; | 2047 qc->close.data = c; |
2049 qc->close.handler = ngx_quic_close_timer_handler; | 2048 qc->close.handler = ngx_quic_close_timer_handler; |
2050 qc->close.cancelable = 1; | 2049 qc->close.cancelable = 1; |
3475 pos += n; | 3474 pos += n; |
3476 | 3475 |
3477 if (gap + 2 > min) { | 3476 if (gap + 2 > min) { |
3478 qc->error = NGX_QUIC_ERR_FRAME_ENCODING_ERROR; | 3477 qc->error = NGX_QUIC_ERR_FRAME_ENCODING_ERROR; |
3479 ngx_log_error(NGX_LOG_INFO, c->log, 0, | 3478 ngx_log_error(NGX_LOG_INFO, c->log, 0, |
3480 "quic invalid range:%ui in ack frame", i); | 3479 "quic invalid range:%ui in ack frame", i); |
3481 return NGX_ERROR; | 3480 return NGX_ERROR; |
3482 } | 3481 } |
3483 | 3482 |
3484 max = min - gap - 2; | 3483 max = min - gap - 2; |
3485 | 3484 |
3486 if (range > max) { | 3485 if (range > max) { |
3487 qc->error = NGX_QUIC_ERR_FRAME_ENCODING_ERROR; | 3486 qc->error = NGX_QUIC_ERR_FRAME_ENCODING_ERROR; |
3488 ngx_log_error(NGX_LOG_INFO, c->log, 0, | 3487 ngx_log_error(NGX_LOG_INFO, c->log, 0, |
3489 "quic invalid range:%ui in ack frame", i); | 3488 "quic invalid range:%ui in ack frame", i); |
3490 return NGX_ERROR; | 3489 return NGX_ERROR; |
3491 } | 3490 } |
3492 | 3491 |
3493 min = max - range; | 3492 min = max - range; |
3494 | 3493 |
3755 /* old/duplicate data range */ | 3754 /* old/duplicate data range */ |
3756 ngx_queue_remove(q); | 3755 ngx_queue_remove(q); |
3757 fs->total -= f->length; | 3756 fs->total -= f->length; |
3758 | 3757 |
3759 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, | 3758 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, |
3760 "quic skipped buffered frame, total:%ui", | 3759 "quic skipped buffered frame, total:%ui", |
3761 fs->total); | 3760 fs->total); |
3762 ngx_quic_free_frame(c, frame); | 3761 ngx_quic_free_frame(c, frame); |
3763 continue; | 3762 continue; |
3764 } | 3763 } |
3765 | 3764 |
3766 /* frame was adjusted, proceed to input */ | 3765 /* frame was adjusted, proceed to input */ |
3782 fs->total -= full_len; | 3781 fs->total -= full_len; |
3783 | 3782 |
3784 ngx_queue_remove(q); | 3783 ngx_queue_remove(q); |
3785 | 3784 |
3786 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, | 3785 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, |
3787 "quic consumed buffered frame, total:%ui", fs->total); | 3786 "quic consumed buffered frame, total:%ui", fs->total); |
3788 | 3787 |
3789 ngx_quic_free_frame(c, frame); | 3788 ngx_quic_free_frame(c, frame); |
3790 | 3789 |
3791 } while (1); | 3790 } while (1); |
3792 | 3791 |
3870 df = &dst->u.ord; | 3869 df = &dst->u.ord; |
3871 | 3870 |
3872 fs->total += f->length; | 3871 fs->total += f->length; |
3873 | 3872 |
3874 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, | 3873 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, |
3875 "quic ordered frame with unexpected offset:" | 3874 "quic ordered frame with unexpected offset:" |
3876 " buffered total:%ui", fs->total); | 3875 " buffered total:%ui", fs->total); |
3877 | 3876 |
3878 if (ngx_queue_empty(&fs->frames)) { | 3877 if (ngx_queue_empty(&fs->frames)) { |
3879 ngx_queue_insert_after(&fs->frames, &dst->queue); | 3878 ngx_queue_insert_after(&fs->frames, &dst->queue); |
3880 return NGX_OK; | 3879 return NGX_OK; |
3881 } | 3880 } |