Mercurial > hg > nginx
comparison src/event/quic/ngx_event_quic_transport.c @ 8924:d6ef13c5fd8e quic
QUIC: simplified configuration.
Directives that set transport parameters are removed from the configuration.
Corresponding values are derived from the quic configuration or initialized
to default. Whenever possible, quic configuration parameters are taken from
higher-level protocol settings, i.e. HTTP/3.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Mon, 06 Dec 2021 15:19:54 +0300 |
parents | cab3b7a070ef |
children | 7106a918a277 |
comparison
equal
deleted
inserted
replaced
8923:651cc905b7c2 | 8924:d6ef13c5fd8e |
---|---|
1935 | 1935 |
1936 return p - start; | 1936 return p - start; |
1937 } | 1937 } |
1938 | 1938 |
1939 | 1939 |
1940 ngx_int_t | |
1941 ngx_quic_init_transport_params(ngx_quic_tp_t *tp, ngx_quic_conf_t *qcf) | |
1942 { | |
1943 ngx_uint_t nstreams; | |
1944 | |
1945 ngx_memzero(tp, sizeof(ngx_quic_tp_t)); | |
1946 | |
1947 /* | |
1948 * set by ngx_memzero(): | |
1949 * | |
1950 * tp->disable_active_migration = 0; | |
1951 * tp->original_dcid = { 0, NULL }; | |
1952 * tp->initial_scid = { 0, NULL }; | |
1953 * tp->retry_scid = { 0, NULL }; | |
1954 * tp->sr_token = { 0 } | |
1955 * tp->sr_enabled = 0 | |
1956 * tp->preferred_address = NULL | |
1957 */ | |
1958 | |
1959 tp->max_idle_timeout = qcf->timeout; | |
1960 | |
1961 tp->max_udp_payload_size = qcf->mtu; | |
1962 | |
1963 nstreams = qcf->max_concurrent_streams_bidi | |
1964 + qcf->max_concurrent_streams_uni; | |
1965 | |
1966 tp->initial_max_data = nstreams * qcf->stream_buffer_size; | |
1967 tp->initial_max_stream_data_bidi_local = qcf->stream_buffer_size; | |
1968 tp->initial_max_stream_data_bidi_remote = qcf->stream_buffer_size; | |
1969 tp->initial_max_stream_data_uni = qcf->stream_buffer_size; | |
1970 | |
1971 tp->initial_max_streams_bidi = qcf->max_concurrent_streams_bidi; | |
1972 tp->initial_max_streams_uni = qcf->max_concurrent_streams_uni; | |
1973 | |
1974 tp->max_ack_delay = NGX_QUIC_DEFAULT_MAX_ACK_DELAY; | |
1975 tp->ack_delay_exponent = NGX_QUIC_DEFAULT_ACK_DELAY_EXPONENT; | |
1976 | |
1977 tp->active_connection_id_limit = 2; | |
1978 tp->disable_active_migration = qcf->disable_active_migration; | |
1979 | |
1980 return NGX_OK; | |
1981 } | |
1982 | |
1983 | |
1940 ssize_t | 1984 ssize_t |
1941 ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp, | 1985 ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp, |
1942 size_t *clen) | 1986 size_t *clen) |
1943 { | 1987 { |
1944 u_char *p; | 1988 u_char *p; |