mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 14:00:01 -04:00
add back handle_handshake calls
This commit is contained in:
parent
7362d512b9
commit
b75f0a2c47
2 changed files with 15 additions and 3 deletions
|
@ -44,10 +44,16 @@ async fn handshake<R: WebSocketRead>(
|
||||||
(closure)(&mut builders).await?;
|
(closure)(&mut builders).await?;
|
||||||
send_info_packet(tx, &mut builders).await?;
|
send_info_packet(tx, &mut builders).await?;
|
||||||
|
|
||||||
|
let mut supported_extensions = get_supported_extensions(info.extensions, &mut builders);
|
||||||
|
|
||||||
|
for extension in supported_extensions.iter_mut() {
|
||||||
|
extension.handle_handshake(rx, tx).await?;
|
||||||
|
}
|
||||||
|
|
||||||
Ok((
|
Ok((
|
||||||
WispHandshakeResult {
|
WispHandshakeResult {
|
||||||
kind: WispHandshakeResultKind::V2 {
|
kind: WispHandshakeResultKind::V2 {
|
||||||
extensions: get_supported_extensions(info.extensions, &mut builders),
|
extensions: supported_extensions,
|
||||||
},
|
},
|
||||||
downgraded: false,
|
downgraded: false,
|
||||||
},
|
},
|
||||||
|
|
|
@ -44,10 +44,16 @@ async fn handshake<R: WebSocketRead>(
|
||||||
Packet::maybe_parse_info(rx.wisp_read_frame(tx).await?, Role::Server, &mut builders)?;
|
Packet::maybe_parse_info(rx.wisp_read_frame(tx).await?, Role::Server, &mut builders)?;
|
||||||
|
|
||||||
if let PacketType::Info(info) = packet.packet_type {
|
if let PacketType::Info(info) = packet.packet_type {
|
||||||
|
let mut supported_extensions = get_supported_extensions(info.extensions, &mut builders);
|
||||||
|
|
||||||
|
for extension in supported_extensions.iter_mut() {
|
||||||
|
extension.handle_handshake(rx, tx).await?;
|
||||||
|
}
|
||||||
|
|
||||||
// v2 client
|
// v2 client
|
||||||
Ok(WispHandshakeResult {
|
Ok(WispHandshakeResult {
|
||||||
kind: WispHandshakeResultKind::V2 {
|
kind: WispHandshakeResultKind::V2 {
|
||||||
extensions: get_supported_extensions(info.extensions, &mut builders),
|
extensions: supported_extensions,
|
||||||
},
|
},
|
||||||
downgraded: false,
|
downgraded: false,
|
||||||
})
|
})
|
||||||
|
@ -55,7 +61,7 @@ async fn handshake<R: WebSocketRead>(
|
||||||
// downgrade to v1
|
// downgrade to v1
|
||||||
Ok(WispHandshakeResult {
|
Ok(WispHandshakeResult {
|
||||||
kind: WispHandshakeResultKind::V1 {
|
kind: WispHandshakeResultKind::V1 {
|
||||||
frame: Some(packet.into()),
|
frame: Some(packet),
|
||||||
},
|
},
|
||||||
downgraded: true,
|
downgraded: true,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue