Make the WebSocket handshake ourselves to ease switching libs

We need to switch to tungstenite to finally update openssl, this commit
rewrites the whole websocket infrastructure to properly follow the Fetch
spec and to make switching to a different websocket library easier.
This commit is contained in:
Anthony Ramine 2017-03-29 17:47:10 +02:00
parent 3ed32f8078
commit d022535f9c
5 changed files with 561 additions and 71 deletions

View file

@ -540,7 +540,7 @@ impl NetworkError {
NetworkError::Internal(error.description().to_owned())
}
fn from_ssl_error(url: &ServoUrl, error: &SslError) -> Self {
pub fn from_ssl_error(url: &ServoUrl, error: &SslError) -> Self {
if let SslError::OpenSslErrors(ref errors) = *error {
if errors.iter().any(is_cert_verify_error) {
let mut error_report = vec![format!("ssl error ({}):", openssl::version::version())];