comparison src/event/quic/ngx_event_quic_migration.c @ 8737:76f476ce4d31 quic

QUIC: distinct files for connection migration. The connection migration-related code from quic.c with dependencies is moved into separate file.
author Vladimir Homutov <vl@nginx.com>
date Wed, 31 Mar 2021 14:57:15 +0300
parents
children c8bda5e1e662
comparison
equal deleted inserted replaced
8736:714e9af983de 8737:76f476ce4d31
1
2 /*
3 * Copyright (C) Nginx, Inc.
4 */
5
6
7 #include <ngx_config.h>
8 #include <ngx_core.h>
9 #include <ngx_event.h>
10 #include <ngx_event_quic_transport.h>
11 #include <ngx_event_quic_connection.h>
12 #include <ngx_event_quic_migration.h>
13
14
15 ngx_int_t
16 ngx_quic_handle_path_challenge_frame(ngx_connection_t *c,
17 ngx_quic_header_t *pkt, ngx_quic_path_challenge_frame_t *f)
18 {
19 ngx_quic_frame_t *frame;
20 ngx_quic_connection_t *qc;
21
22 qc = ngx_quic_get_connection(c);
23
24 frame = ngx_quic_alloc_frame(c);
25 if (frame == NULL) {
26 return NGX_ERROR;
27 }
28
29 frame->level = pkt->level;
30 frame->type = NGX_QUIC_FT_PATH_RESPONSE;
31 frame->u.path_response = *f;
32
33 ngx_quic_queue_frame(qc, frame);
34
35 return NGX_OK;
36 }
37
38
39 ngx_int_t
40 ngx_quic_handle_path_response_frame(ngx_connection_t *c,
41 ngx_quic_header_t *pkt, ngx_quic_path_challenge_frame_t *f)
42 {
43 /* TODO */
44 return NGX_OK;
45 }
46