Auto merge of #27164 - jdm:tungstenite, r=nox

Replace ws-rs with async-tungstenite.

This change moves us from ws-rs (which doesn't see a lot of maintainer activity) and its custom async implementation to tungstenite and the tokio ecosystem. This is particularly important because of #27043, which breaks SSL websockets on Windows.

Depends on https://github.com/sdroege/async-tungstenite/pull/40/.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #27043
- [x] There are tests for these changes
This commit is contained in:
bors-servo 2020-07-08 16:48:51 -04:00 committed by GitHub
commit ed827223ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 765 additions and 324 deletions

358
Cargo.lock generated
View file

@ -177,6 +177,22 @@ dependencies = [
"libloading 0.6.1",
]
[[package]]
name = "async-tungstenite"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2760f968801f873112e651c5a9c3b60c11ae6d66e7ca3f2d51aafbfcef9495fa"
dependencies = [
"futures-io",
"futures-util",
"log",
"openssl",
"pin-project",
"tokio 0.2.21",
"tokio-openssl 0.4.0",
"tungstenite",
]
[[package]]
name = "atom"
version = "0.3.5"
@ -480,6 +496,15 @@ dependencies = [
"iovec",
]
[[package]]
name = "bytes"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "118cf036fbb97d0816e3c34b2d7a1e8cfc60f68fcf63d550ddbe9bd5f59c213b"
dependencies = [
"loom",
]
[[package]]
name = "bzip2"
version = "0.3.3"
@ -821,7 +846,7 @@ dependencies = [
"gaol",
"gfx",
"gfx_traits",
"http",
"http 0.1.21",
"ipc-channel",
"keyboard-types",
"layout_traits",
@ -1210,7 +1235,7 @@ dependencies = [
"devtools_traits",
"embedder_traits",
"headers",
"http",
"http 0.1.21",
"hyper",
"ipc-channel",
"log",
@ -1228,7 +1253,7 @@ name = "devtools_traits"
version = "0.0.1"
dependencies = [
"bitflags",
"http",
"http 0.1.21",
"ipc-channel",
"malloc_size_of",
"malloc_size_of_derive",
@ -1598,6 +1623,21 @@ version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869"
[[package]]
name = "futures"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613"
dependencies = [
"futures-channel",
"futures-core",
"futures-executor",
"futures-io",
"futures-sink",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-channel"
version = "0.3.5"
@ -1605,6 +1645,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5"
dependencies = [
"futures-core",
"futures-sink",
]
[[package]]
@ -1619,7 +1660,7 @@ version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4"
dependencies = [
"futures",
"futures 0.1.28",
"num_cpus",
]
@ -1634,6 +1675,12 @@ dependencies = [
"futures-util",
]
[[package]]
name = "futures-io"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789"
[[package]]
name = "futures-macro"
version = "0.3.5"
@ -1667,9 +1714,13 @@ version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
dependencies = [
"futures-channel",
"futures-core",
"futures-io",
"futures-macro",
"futures-sink",
"futures-task",
"memchr",
"pin-project",
"pin-utils",
"proc-macro-hack",
@ -1696,6 +1747,19 @@ dependencies = [
"log",
]
[[package]]
name = "generator"
version = "0.6.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "add72f17bb81521258fcc8a7a3245b1e184e916bfbe34f0ea89558f440df5c68"
dependencies = [
"cc",
"libc",
"log",
"rustc_version",
"winapi",
]
[[package]]
name = "generic-array"
version = "0.12.3"
@ -2333,10 +2397,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462"
dependencies = [
"byteorder",
"bytes",
"bytes 0.4.12",
"fnv",
"futures",
"http",
"futures 0.1.28",
"http 0.1.21",
"indexmap",
"log",
"slab",
@ -2380,9 +2444,9 @@ checksum = "882ca7d8722f33ce2c2db44f95425d6267ed59ca96ce02acbe58320054ceb642"
dependencies = [
"base64 0.10.1",
"bitflags",
"bytes",
"bytes 0.4.12",
"headers-core",
"http",
"http 0.1.21",
"mime",
"sha-1",
"time",
@ -2394,8 +2458,8 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "967131279aaa9f7c20c7205b45a391638a83ab118e6509b2d0ccbe08de044237"
dependencies = [
"bytes",
"http",
"bytes 0.4.12",
"http 0.1.21",
]
[[package]]
@ -2457,7 +2521,18 @@ version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0"
dependencies = [
"bytes",
"bytes 0.4.12",
"fnv",
"itoa",
]
[[package]]
name = "http"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9"
dependencies = [
"bytes 0.5.5",
"fnv",
"itoa",
]
@ -2468,9 +2543,9 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d"
dependencies = [
"bytes",
"futures",
"http",
"bytes 0.4.12",
"futures 0.1.28",
"http 0.1.21",
"tokio-buf",
]
@ -2495,11 +2570,11 @@ version = "0.12.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6"
dependencies = [
"bytes",
"futures",
"bytes 0.4.12",
"futures 0.1.28",
"futures-cpupool",
"h2",
"http",
"http 0.1.21",
"http-body",
"httparse",
"iovec",
@ -2508,7 +2583,7 @@ dependencies = [
"net2",
"rustc_version",
"time",
"tokio",
"tokio 0.1.22",
"tokio-buf",
"tokio-executor",
"tokio-io",
@ -2526,15 +2601,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f52657b5cdb2a8067efd29a02e011b7cf656b473ec8a5c34e86645e85d763006"
dependencies = [
"antidote",
"bytes",
"futures",
"bytes 0.4.12",
"futures 0.1.28",
"hyper",
"lazy_static",
"linked_hash_set",
"openssl",
"openssl-sys",
"tokio-io",
"tokio-openssl",
"tokio-openssl 0.3.0",
]
[[package]]
@ -2545,7 +2620,7 @@ checksum = "3bf0fc731a638339172253834b4ba8d60a9ecbeb4c031fcfcacd25b3cdf6e6c1"
dependencies = [
"cookie",
"headers",
"http",
"http 0.1.21",
"hyper",
"mime",
"serde",
@ -2617,6 +2692,15 @@ dependencies = [
"adler32",
]
[[package]]
name = "input_buffer"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19a8a95243d5a0398cae618ec29477c6e3cb631152be5c19481f80bc71559754"
dependencies = [
"bytes 0.5.5",
]
[[package]]
name = "io-surface"
version = "0.12.1"
@ -3140,6 +3224,17 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "loom"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ecc775857611e1df29abba5c41355cdf540e7e9d4acfdf0f355eefee82330b7"
dependencies = [
"cfg-if",
"generator",
"scoped-tls 0.1.2",
]
[[package]]
name = "lyon_geom"
version = "0.14.1"
@ -3402,9 +3497,10 @@ dependencies = [
[[package]]
name = "mio"
version = "0.6.18"
source = "git+https://github.com/servo/mio.git?branch=servo#846242c05bacacda9a67033551eb33027f2648fc"
version = "0.6.22"
source = "git+https://github.com/servo/mio.git?branch=servo-mio-0.6.22#f640fd662db03026ca2a1b21ac1e161ec6f8150b"
dependencies = [
"cfg-if",
"fuchsia-zircon",
"fuchsia-zircon-sys",
"iovec",
@ -3542,13 +3638,32 @@ dependencies = [
"spirv_headers",
]
[[package]]
name = "native-tls"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d"
dependencies = [
"lazy_static",
"libc",
"log",
"openssl",
"openssl-probe",
"openssl-sys",
"schannel",
"security-framework",
"security-framework-sys",
"tempfile",
]
[[package]]
name = "net"
version = "0.0.1"
dependencies = [
"async-tungstenite",
"base64 0.10.1",
"brotli",
"bytes",
"bytes 0.4.12",
"content-security-policy",
"cookie",
"crossbeam-channel",
@ -3556,9 +3671,10 @@ dependencies = [
"devtools_traits",
"embedder_traits",
"flate2",
"futures",
"futures 0.1.28",
"futures 0.3.5",
"headers",
"http",
"http 0.1.21",
"hyper",
"hyper-openssl",
"hyper_serde",
@ -3587,12 +3703,13 @@ dependencies = [
"servo_url",
"std_test_override",
"time",
"tokio",
"tokio-openssl",
"tokio 0.1.22",
"tokio 0.2.21",
"tokio-openssl 0.3.0",
"tungstenite",
"url",
"uuid",
"webrender_api",
"ws",
]
[[package]]
@ -3614,7 +3731,7 @@ dependencies = [
"cookie",
"embedder_traits",
"headers",
"http",
"http 0.1.21",
"hyper",
"hyper_serde",
"image",
@ -3817,6 +3934,12 @@ dependencies = [
"openssl-sys",
]
[[package]]
name = "openssl-probe"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
[[package]]
name = "openssl-sys"
version = "0.9.58"
@ -4082,6 +4205,12 @@ dependencies = [
"syn",
]
[[package]]
name = "pin-project-lite"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715"
[[package]]
name = "pin-utils"
version = "0.1.0"
@ -4521,6 +4650,22 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "schannel"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75"
dependencies = [
"lazy_static",
"winapi",
]
[[package]]
name = "scoped-tls"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28"
[[package]]
name = "scoped-tls"
version = "1.0.0"
@ -4568,7 +4713,7 @@ dependencies = [
"fxhash",
"headers",
"html5ever",
"http",
"http 0.1.21",
"hyper",
"hyper_serde",
"image",
@ -4703,7 +4848,7 @@ dependencies = [
"embedder_traits",
"euclid",
"gfx_traits",
"http",
"http 0.1.21",
"hyper",
"hyper_serde",
"ipc-channel",
@ -4730,6 +4875,29 @@ dependencies = [
"webxr-api",
]
[[package]]
name = "security-framework"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535"
dependencies = [
"bitflags",
"core-foundation 0.7.0",
"core-foundation-sys 0.7.0",
"libc",
"security-framework-sys",
]
[[package]]
name = "security-framework-sys"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405"
dependencies = [
"core-foundation-sys 0.7.0",
"libc",
]
[[package]]
name = "selectors"
version = "0.22.0"
@ -5421,7 +5589,7 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d"
dependencies = [
"bytes",
"bytes 0.4.12",
]
[[package]]
@ -5809,8 +5977,8 @@ version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6"
dependencies = [
"bytes",
"futures",
"bytes 0.4.12",
"futures 0.1.28",
"mio",
"num_cpus",
"tokio-codec",
@ -5827,15 +5995,31 @@ dependencies = [
"tokio-uds",
]
[[package]]
name = "tokio"
version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d099fa27b9702bed751524694adbe393e18b36b204da91eb1cbbbbb4a5ee2d58"
dependencies = [
"bytes 0.5.5",
"fnv",
"iovec",
"lazy_static",
"mio",
"num_cpus",
"pin-project-lite",
"tokio-macros",
]
[[package]]
name = "tokio-buf"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46"
dependencies = [
"bytes",
"bytes 0.4.12",
"either",
"futures",
"futures 0.1.28",
]
[[package]]
@ -5844,8 +6028,8 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b"
dependencies = [
"bytes",
"futures",
"bytes 0.4.12",
"futures 0.1.28",
"tokio-io",
]
@ -5855,7 +6039,7 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e"
dependencies = [
"futures",
"futures 0.1.28",
"tokio-executor",
]
@ -5866,7 +6050,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671"
dependencies = [
"crossbeam-utils",
"futures",
"futures 0.1.28",
]
[[package]]
@ -5875,7 +6059,7 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4"
dependencies = [
"futures",
"futures 0.1.28",
"tokio-io",
"tokio-threadpool",
]
@ -5886,22 +6070,43 @@ version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674"
dependencies = [
"bytes",
"futures",
"bytes 0.4.12",
"futures 0.1.28",
"log",
]
[[package]]
name = "tokio-macros"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389"
dependencies = [
"proc-macro2 1.0.17",
"quote 1.0.2",
"syn",
]
[[package]]
name = "tokio-openssl"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "771d6246b170ae108d67d9963c23f31a579016c016d73bd4bd7d6ef0252afda7"
dependencies = [
"futures",
"futures 0.1.28",
"openssl",
"tokio-io",
]
[[package]]
name = "tokio-openssl"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c4b08c5f4208e699ede3df2520aca2e82401b2de33f45e96696a074480be594"
dependencies = [
"openssl",
"tokio 0.2.21",
]
[[package]]
name = "tokio-reactor"
version = "0.1.12"
@ -5909,7 +6114,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351"
dependencies = [
"crossbeam-utils",
"futures",
"futures 0.1.28",
"lazy_static",
"log",
"mio",
@ -5928,7 +6133,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee"
dependencies = [
"fnv",
"futures",
"futures 0.1.28",
]
[[package]]
@ -5937,8 +6142,8 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72"
dependencies = [
"bytes",
"futures",
"bytes 0.4.12",
"futures 0.1.28",
"iovec",
"mio",
"tokio-io",
@ -5954,7 +6159,7 @@ dependencies = [
"crossbeam-deque",
"crossbeam-queue",
"crossbeam-utils",
"futures",
"futures 0.1.28",
"lazy_static",
"log",
"num_cpus",
@ -5969,7 +6174,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296"
dependencies = [
"crossbeam-utils",
"futures",
"futures 0.1.28",
"slab",
"tokio-executor",
]
@ -5980,8 +6185,8 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82"
dependencies = [
"bytes",
"futures",
"bytes 0.4.12",
"futures 0.1.28",
"log",
"mio",
"tokio-codec",
@ -5995,8 +6200,8 @@ version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0"
dependencies = [
"bytes",
"futures",
"bytes 0.4.12",
"futures 0.1.28",
"iovec",
"libc",
"log",
@ -6053,6 +6258,26 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382"
[[package]]
name = "tungstenite"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5c7d464221cb0b538a1cd12f6d9127ed1e6bb7f3ffca98fb3cd4c6e3af8175c"
dependencies = [
"base64 0.12.0",
"byteorder",
"bytes 0.5.5",
"http 0.2.1",
"httparse",
"input_buffer",
"log",
"native-tls",
"rand",
"sha-1",
"url",
"utf-8",
]
[[package]]
name = "typed-arena"
version = "2.0.1"
@ -6235,7 +6460,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230"
dependencies = [
"futures",
"futures 0.1.28",
"log",
"try-lock",
]
@ -6246,19 +6471,19 @@ version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99b53196ba54e91e31ba1e90309a31053218cc1d4697f6e48f7c7e3d255e64fc"
dependencies = [
"bytes",
"futures",
"bytes 0.4.12",
"futures 0.1.28",
"headers",
"http",
"http 0.1.21",
"hyper",
"log",
"mime",
"mime_guess",
"scoped-tls",
"scoped-tls 1.0.0",
"serde",
"serde_json",
"serde_urlencoded",
"tokio",
"tokio 0.1.22",
"tokio-io",
"tokio-threadpool",
"urlencoding",
@ -6401,14 +6626,14 @@ checksum = "ad517a7e5bb5228bee491b97f5c471b31606a42e89fda90a966d8245a4308e31"
dependencies = [
"base64 0.10.1",
"cookie",
"http",
"http 0.1.21",
"log",
"regex",
"serde",
"serde_derive",
"serde_json",
"time",
"tokio",
"tokio 0.1.22",
"unicode-segmentation",
"url",
"warp",
@ -6721,12 +6946,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c51a2c47b5798ccc774ffb93ff536aec7c4275d722fd9c740c83cdd1af1f2d94"
dependencies = [
"byteorder",
"bytes",
"bytes 0.4.12",
"httparse",
"log",
"mio",
"mio-extras",
"openssl",
"rand",
"sha-1",
"slab",