mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 05:50: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?;
|
||||
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((
|
||||
WispHandshakeResult {
|
||||
kind: WispHandshakeResultKind::V2 {
|
||||
extensions: get_supported_extensions(info.extensions, &mut builders),
|
||||
extensions: supported_extensions,
|
||||
},
|
||||
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)?;
|
||||
|
||||
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
|
||||
Ok(WispHandshakeResult {
|
||||
kind: WispHandshakeResultKind::V2 {
|
||||
extensions: get_supported_extensions(info.extensions, &mut builders),
|
||||
extensions: supported_extensions,
|
||||
},
|
||||
downgraded: false,
|
||||
})
|
||||
|
@ -55,7 +61,7 @@ async fn handshake<R: WebSocketRead>(
|
|||
// downgrade to v1
|
||||
Ok(WispHandshakeResult {
|
||||
kind: WispHandshakeResultKind::V1 {
|
||||
frame: Some(packet.into()),
|
||||
frame: Some(packet),
|
||||
},
|
||||
downgraded: true,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue