aboutsummaryrefslogtreecommitdiffstats
path: root/components/net_traits/lib.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-03-24 10:48:24 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2017-03-24 11:09:30 +0100
commita6d22b1a357b649b68d5adb93fce7cd6d87b8d08 (patch)
treea4274aec6f7e5d2494049cc6a0e438ec7ed4fc50 /components/net_traits/lib.rs
parent189b0d9094a8448aedd778ae2aac538a3a9e4871 (diff)
downloadservo-a6d22b1a357b649b68d5adb93fce7cd6d87b8d08.tar.gz
servo-a6d22b1a357b649b68d5adb93fce7cd6d87b8d08.zip
Only pass the protocol in use in to establish a WS connection
Diffstat (limited to 'components/net_traits/lib.rs')
-rw-r--r--components/net_traits/lib.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/components/net_traits/lib.rs b/components/net_traits/lib.rs
index 36fc77edacc..768996b6748 100644
--- a/components/net_traits/lib.rs
+++ b/components/net_traits/lib.rs
@@ -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);