From 108bfa436f5eeb3f4cf26d2e48d6c05da57f4e43 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 3 Jul 2018 11:28:12 +0200 Subject: [PATCH] Store protocol version in ConnectionState --- src/conn_state.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/conn_state.rs b/src/conn_state.rs index 85ce40ca2..eb4702da3 100644 --- a/src/conn_state.rs +++ b/src/conn_state.rs @@ -29,6 +29,7 @@ pub struct ConnectionState { control: VecDeque, tls: T, pmtu: usize, + version: u32, } impl ConnectionState @@ -77,6 +78,7 @@ where queue: VecDeque::new(), control: VecDeque::new(), pmtu: IPV6_MIN_MTU, + version: QUIC_VERSION, } } @@ -171,7 +173,7 @@ where let header = match ptype { Some(ltype) => Header::Long { ptype: ltype, - version: QUIC_VERSION, + version: self.version, dst_cid, src_cid, len: (payload_len + tag_len) as u64,