mirror of
https://github.com/servo/servo.git
synced 2025-07-29 02:00:23 +01:00
Only pass the protocol in use in to establish a WS connection
This commit is contained in:
parent
189b0d9094
commit
a6d22b1a35
6 changed files with 23 additions and 29 deletions
|
@ -348,9 +348,9 @@ pub enum WebSocketDomAction {
|
|||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum WebSocketNetworkEvent {
|
||||
ConnectionEstablished(#[serde(deserialize_with = "::hyper_serde::deserialize",
|
||||
serialize_with = "::hyper_serde::serialize")]
|
||||
header::Headers),
|
||||
ConnectionEstablished {
|
||||
protocol_in_use: Option<String>,
|
||||
},
|
||||
MessageReceived(MessageData),
|
||||
Close(Option<u16>, String),
|
||||
Fail,
|
||||
|
@ -514,11 +514,6 @@ pub fn load_whole_resource(request: RequestInit,
|
|||
}
|
||||
}
|
||||
|
||||
/// Defensively unwraps the protocol string from the response object's protocol
|
||||
pub fn unwrap_websocket_protocol(wsp: Option<&header::WebSocketProtocol>) -> Option<&str> {
|
||||
wsp.and_then(|protocol_list| protocol_list.get(0).map(|protocol| protocol.as_ref()))
|
||||
}
|
||||
|
||||
/// An unique identifier to keep track of each load message in the resource handler
|
||||
#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
pub struct ResourceId(pub u32);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue