bump wire version and ALPN to draft-25
This also retains older draft versions.
diff --git a/examples/client.c b/examples/client.c
index 7e3c745..c4ddce1 100644
--- a/examples/client.c
+++ b/examples/client.c
@@ -243,7 +243,7 @@
}
quiche_config_set_application_protos(config,
- (uint8_t *) "\x05hq-24\x05hq-23\x08http/0.9", 15);
+ (uint8_t *) "\x05hq-25\x05hq-24\x05hq-23\x08http/0.9", 15);
quiche_config_set_idle_timeout(config, 5000);
quiche_config_set_max_packet_size(config, MAX_DATAGRAM_SIZE);
diff --git a/examples/client.rs b/examples/client.rs
index e0da72d..b49255e 100644
--- a/examples/client.rs
+++ b/examples/client.rs
@@ -115,7 +115,7 @@
config.verify_peer(true);
config
- .set_application_protos(b"\x05hq-24\x05hq-23\x08http/0.9")
+ .set_application_protos(b"\x05hq-25\x05hq-24\x05hq-23\x08http/0.9")
.unwrap();
config.set_idle_timeout(5000);
diff --git a/examples/server.c b/examples/server.c
index 121d1b0..41fd76b 100644
--- a/examples/server.c
+++ b/examples/server.c
@@ -443,7 +443,7 @@
quiche_config_load_priv_key_from_pem_file(config, "examples/cert.key");
quiche_config_set_application_protos(config,
- (uint8_t *) "\x05hq-24\x05hq-23\x08http/0.9", 21);
+ (uint8_t *) "\x05hq-25\x05hq-24\x05hq-23\x08http/0.9", 21);
quiche_config_set_idle_timeout(config, 5000);
quiche_config_set_max_packet_size(config, MAX_DATAGRAM_SIZE);
diff --git a/examples/server.rs b/examples/server.rs
index 735c618..d30dd56 100644
--- a/examples/server.rs
+++ b/examples/server.rs
@@ -129,7 +129,7 @@
.unwrap();
config
- .set_application_protos(b"\x05hq-24\x05hq-23\x08http/0.9")
+ .set_application_protos(b"\x05hq-25\x05hq-24\x05hq-23\x08http/0.9")
.unwrap();
config.set_idle_timeout(5000);
diff --git a/include/quiche.h b/include/quiche.h
index 7537e29..3870e5a 100644
--- a/include/quiche.h
+++ b/include/quiche.h
@@ -38,7 +38,7 @@
//
// The current QUIC wire version.
-#define QUICHE_PROTOCOL_VERSION 0xff000018
+#define QUICHE_PROTOCOL_VERSION 0xff000019
// The maximum length of a connection ID.
#define QUICHE_MAX_CONN_ID_LEN 20
@@ -328,7 +328,7 @@
//
// List of ALPN tokens of supported HTTP/3 versions.
-#define QUICHE_H3_APPLICATION_PROTOCOL "\x05h3-24\x05h3-23"
+#define QUICHE_H3_APPLICATION_PROTOCOL "\x05h3-25\x05h3-24\x05h3-23"
// Stores configuration shared between multiple connections.
typedef struct Http3Config quiche_h3_config;
diff --git a/src/h3/mod.rs b/src/h3/mod.rs
index 568f933..6e327b0 100644
--- a/src/h3/mod.rs
+++ b/src/h3/mod.rs
@@ -258,7 +258,7 @@
///
/// [`Config::set_application_protos()`]:
/// ../struct.Config.html#method.set_application_protos
-pub const APPLICATION_PROTOCOL: &[u8] = b"\x05h3-24\x05h3-23";
+pub const APPLICATION_PROTOCOL: &[u8] = b"\x05h3-25\x05h3-24\x05h3-23";
/// A specialized [`Result`] type for quiche HTTP/3 operations.
///
diff --git a/src/lib.rs b/src/lib.rs
index 8086d57..0d5e0d1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -274,8 +274,14 @@
pub use crate::cc::Algorithm as CongestionControlAlgorithm;
/// The current QUIC wire version.
-pub const PROTOCOL_VERSION: u32 = 0xff00_0018;
-const PROTOCOL_VERSION_OLD: u32 = 0xff00_0017;
+pub const PROTOCOL_VERSION: u32 = PROTOCOL_VERSION_DRAFT25;
+
+/// Supported QUIC versions.
+///
+/// Note that the older ones might not be fully supported.
+const PROTOCOL_VERSION_DRAFT25: u32 = 0xff00_0019;
+const PROTOCOL_VERSION_DRAFT24: u32 = 0xff00_0018;
+const PROTOCOL_VERSION_DRAFT23: u32 = 0xff00_0017;
/// The maximum length of a connection ID.
pub const MAX_CONN_ID_LEN: usize = crate::packet::MAX_CID_LEN as usize;
@@ -957,7 +963,13 @@
/// Returns true if the given protocol version is supported.
pub fn version_is_supported(version: u32) -> bool {
- version == PROTOCOL_VERSION || version == PROTOCOL_VERSION_OLD
+ match version {
+ PROTOCOL_VERSION |
+ PROTOCOL_VERSION_DRAFT24 |
+ PROTOCOL_VERSION_DRAFT23 => true,
+
+ _ => false,
+ }
}
impl Connection {
diff --git a/src/packet.rs b/src/packet.rs
index 13af75f..1224e68 100644
--- a/src/packet.rs
+++ b/src/packet.rs
@@ -587,7 +587,8 @@
b.put_u8(dcid.len() as u8)?;
b.put_bytes(&dcid)?;
b.put_u32(crate::PROTOCOL_VERSION)?;
- b.put_u32(crate::PROTOCOL_VERSION_OLD)?;
+ b.put_u32(crate::PROTOCOL_VERSION_DRAFT24)?;
+ b.put_u32(crate::PROTOCOL_VERSION_DRAFT23)?;
Ok(b.off())
}