diff options
| author | Sergey Kandaurov <pluknet@nginx.com> | 2020-11-10 00:32:56 +0300 |
|---|---|---|
| committer | Sergey Kandaurov <pluknet@nginx.com> | 2020-11-10 00:32:56 +0300 |
| commit | b19923f91bd41f17470c0d4538ba15adcc0b95e8 (patch) | |
| tree | 46f5758ae9d63dbc24ad52c0c8fdc9720e151706 /src/event | |
| parent | 7f434603875b35998f09e43e8ed27381bb8094cb (diff) | |
| download | nginx-b19923f91bd41f17470c0d4538ba15adcc0b95e8.tar.gz nginx-b19923f91bd41f17470c0d4538ba15adcc0b95e8.tar.bz2 | |
QUIC: multiple versions support in ALPN.
Previously, a version based on NGX_QUIC_DRAFT_VERSION was always set.
Now it is taken from the negotiated QUIC version that may differ.
Diffstat (limited to 'src/event')
| -rw-r--r-- | src/event/ngx_event_quic.c | 11 | ||||
| -rw-r--r-- | src/event/ngx_event_quic.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c index a7e474803..49ed8f7ba 100644 --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -5813,3 +5813,14 @@ ngx_quic_free_frame(ngx_connection_t *c, ngx_quic_frame_t *frame) "quic free frame n:%ui", qc->nframes); #endif } + + +uint32_t +ngx_quic_version(ngx_connection_t *c) +{ + uint32_t version; + + version = c->quic->version; + + return (version & 0xff000000) == 0xff000000 ? version & 0xff : version; +} diff --git a/src/event/ngx_event_quic.h b/src/event/ngx_event_quic.h index e8bf926a0..fc41e0ce6 100644 --- a/src/event/ngx_event_quic.h +++ b/src/event/ngx_event_quic.h @@ -122,6 +122,7 @@ void ngx_quic_run(ngx_connection_t *c, ngx_quic_conf_t *conf); ngx_connection_t *ngx_quic_open_stream(ngx_connection_t *c, ngx_uint_t bidi); void ngx_quic_finalize_connection(ngx_connection_t *c, ngx_uint_t err, const char *reason); +uint32_t ngx_quic_version(ngx_connection_t *c); /********************************* DEBUG *************************************/ |
