diff --git a/Cargo.lock b/Cargo.lock index a6f8dbf5fc..a7229975ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,19 +4,13 @@ version = 4 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -147,6 +141,12 @@ dependencies = [ "syn", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.4.0" @@ -155,18 +155,17 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.6.20" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", "axum-core", - "bitflags 1.3.2", "bytes", "futures-util", - "http", + "http 1.2.0", "http-body", - "hyper", + "http-body-util", "itoa", "matchit", "memchr", @@ -176,41 +175,44 @@ dependencies = [ "rustversion", "serde", "sync_wrapper", - "tower", + "tower 0.5.2", "tower-layer", "tower-service", ] [[package]] name = "axum-core" -version = "0.3.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", "bytes", "futures-util", - "http", + "http 1.2.0", "http-body", + "http-body-util", "mime", + "pin-project-lite", "rustversion", + "sync_wrapper", "tower-layer", "tower-service", ] [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -221,15 +223,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bindgen" @@ -237,10 +233,10 @@ version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.8.0", "cexpr", "clang-sys", - "itertools", + "itertools 0.13.0", "proc-macro2", "quote", "regex", @@ -257,9 +253,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "block-buffer" @@ -276,7 +272,7 @@ version = "4.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f5aac023c3ba13725de1604aff621a9dbf9a4f3af1ea6fb712bca91ad729a8e" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.8.0", "boring-sys", "foreign-types", "libc", @@ -485,7 +481,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d105028bd2b5dfcb33318fd79a445001ead36004dd8dffef1bdd7e493d8bc1e" dependencies = [ "tokio", - "tower", + "tower 0.4.13", ] [[package]] @@ -502,9 +498,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "enum-as-inner" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ "heck", "proc-macro2", @@ -545,7 +541,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -579,7 +575,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -758,9 +754,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -797,16 +793,16 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.26" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", - "http", + "http 1.2.0", "indexmap 2.7.1", "slab", "tokio", @@ -828,9 +824,9 @@ checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -902,9 +898,20 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -913,12 +920,24 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http", + "http 1.2.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.2.0", + "http-body", "pin-project-lite", ] @@ -942,25 +961,22 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.32" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", - "http", + "http 1.2.0", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] @@ -969,25 +985,45 @@ name = "hyper-balance" version = "0.1.0" dependencies = [ "futures", - "http", + "http 1.2.0", "http-body", "hyper", "pin-project", "tokio", "tokio-test", - "tower", + "tower 0.4.13", ] [[package]] name = "hyper-timeout" -version = "0.4.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ "hyper", + "hyper-util", "pin-project-lite", "tokio", - "tokio-io-timeout", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.2.0", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", ] [[package]] @@ -1176,6 +1212,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.14" @@ -1213,10 +1258,11 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -1261,7 +1307,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -1274,7 +1320,7 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" name = "linkerd-addr" version = "0.1.0" dependencies = [ - "http", + "http 1.2.0", "ipnet", "linkerd-dns-name", "thiserror 2.0.11", @@ -1300,7 +1346,7 @@ dependencies = [ "tokio", "tokio-stream", "tonic", - "tower", + "tower 0.4.13", "tracing", ] @@ -1311,7 +1357,7 @@ dependencies = [ "bytes", "deflate", "futures", - "http", + "http 1.2.0", "http-body", "hyper", "linkerd-app-core", @@ -1322,7 +1368,7 @@ dependencies = [ "serde_json", "thiserror 2.0.11", "tokio", - "tower", + "tower 0.4.13", "tracing", ] @@ -1333,7 +1379,7 @@ dependencies = [ "bytes", "drain", "futures", - "http", + "http 1.2.0", "http-body", "hyper", "ipnet", @@ -1390,7 +1436,7 @@ dependencies = [ "tokio", "tokio-stream", "tonic", - "tower", + "tower 0.4.13", "tracing", ] @@ -1399,7 +1445,7 @@ name = "linkerd-app-gateway" version = "0.1.0" dependencies = [ "futures", - "http", + "http 1.2.0", "linkerd-app-core", "linkerd-app-inbound", "linkerd-app-outbound", @@ -1411,7 +1457,7 @@ dependencies = [ "tokio", "tokio-test", "tonic", - "tower", + "tower 0.4.13", "tower-test", "tracing", ] @@ -1423,7 +1469,7 @@ dependencies = [ "arbitrary", "bytes", "futures", - "http", + "http 1.2.0", "hyper", "libfuzzer-sys", "linkerd-app-core", @@ -1447,7 +1493,7 @@ dependencies = [ "tokio", "tokio-test", "tonic", - "tower", + "tower 0.4.13", "tracing", ] @@ -1459,7 +1505,7 @@ dependencies = [ "flate2", "futures", "h2", - "http", + "http 1.2.0", "http-body", "hyper", "ipnet", @@ -1481,7 +1527,7 @@ dependencies = [ "tokio-rustls", "tokio-stream", "tonic", - "tower", + "tower 0.4.13", "tracing", "tracing-subscriber", ] @@ -1494,7 +1540,7 @@ dependencies = [ "bytes", "futures", "futures-util", - "http", + "http 1.2.0", "http-body", "hyper", "linkerd-app-core", @@ -1526,7 +1572,7 @@ dependencies = [ "tokio-rustls", "tokio-test", "tonic", - "tower", + "tower 0.4.13", "tower-test", "tracing", ] @@ -1537,7 +1583,7 @@ version = "0.1.0" dependencies = [ "futures", "h2", - "http", + "http 1.2.0", "http-body", "hyper", "linkerd-app-core", @@ -1553,7 +1599,7 @@ dependencies = [ "tokio-stream", "tokio-test", "tonic", - "tower", + "tower 0.4.13", "tracing", "tracing-subscriber", ] @@ -1573,7 +1619,7 @@ dependencies = [ "linkerd-stack", "thiserror 2.0.11", "tokio", - "tower", + "tower 0.4.13", "tracing", ] @@ -1663,7 +1709,7 @@ name = "linkerd-http-access-log" version = "0.1.0" dependencies = [ "futures-core", - "http", + "http 1.2.0", "humantime", "linkerd-identity", "linkerd-proxy-transport", @@ -1681,7 +1727,7 @@ version = "0.1.0" dependencies = [ "bytes", "futures", - "http", + "http 1.2.0", "http-body", "linkerd-error", "linkerd-stack", @@ -1693,7 +1739,7 @@ name = "linkerd-http-classify" version = "0.1.0" dependencies = [ "futures", - "http", + "http 1.2.0", "http-body", "linkerd-error", "linkerd-http-box", @@ -1724,10 +1770,10 @@ name = "linkerd-http-insert" version = "0.1.0" dependencies = [ "futures", - "http", + "http 1.2.0", "linkerd-stack", "pin-project", - "tower", + "tower 0.4.13", ] [[package]] @@ -1736,7 +1782,7 @@ version = "0.1.0" dependencies = [ "bytes", "futures", - "http", + "http 1.2.0", "http-body", "hyper", "linkerd-error", @@ -1746,7 +1792,7 @@ dependencies = [ "parking_lot", "pin-project", "tokio", - "tower", + "tower 0.4.13", "tracing", ] @@ -1754,9 +1800,9 @@ dependencies = [ name = "linkerd-http-override-authority" version = "0.1.0" dependencies = [ - "http", + "http 1.2.0", "linkerd-stack", - "tower", + "tower 0.4.13", "tracing", ] @@ -1766,7 +1812,7 @@ version = "0.1.0" dependencies = [ "bytes", "futures", - "http", + "http 1.2.0", "http-body", "linkerd-error", "linkerd-http-box", @@ -1783,11 +1829,11 @@ dependencies = [ name = "linkerd-http-retain" version = "0.1.0" dependencies = [ - "http", + "http 1.2.0", "http-body", "linkerd-stack", "pin-project", - "tower", + "tower 0.4.13", ] [[package]] @@ -1796,7 +1842,7 @@ version = "0.1.0" dependencies = [ "bytes", "futures", - "http", + "http 1.2.0", "http-body", "hyper", "linkerd-error", @@ -1809,7 +1855,7 @@ dependencies = [ "pin-project", "thiserror 2.0.11", "tokio", - "tower", + "tower 0.4.13", "tracing", ] @@ -1817,7 +1863,7 @@ dependencies = [ name = "linkerd-http-route" version = "0.1.0" dependencies = [ - "http", + "http 1.2.0", "linkerd2-proxy-api", "maplit", "rand", @@ -1832,7 +1878,7 @@ name = "linkerd-http-stream-timeouts" version = "0.1.0" dependencies = [ "futures", - "http", + "http 1.2.0", "http-body", "linkerd-error", "linkerd-stack", @@ -1850,9 +1896,10 @@ dependencies = [ "bytes", "drain", "futures", - "http", + "http 1.2.0", "http-body", "hyper", + "hyper-util", "linkerd-duplex", "linkerd-error", "linkerd-http-box", @@ -1862,7 +1909,7 @@ dependencies = [ "pin-project", "thiserror 2.0.11", "tokio", - "tower", + "tower 0.4.13", "tracing", "try-lock", ] @@ -1871,7 +1918,7 @@ dependencies = [ name = "linkerd-http-variant" version = "0.1.0" dependencies = [ - "http", + "http 1.2.0", "thiserror 2.0.11", ] @@ -1898,7 +1945,7 @@ dependencies = [ "linkerd-tracing", "parking_lot", "tokio", - "tower", + "tower 0.4.13", "tracing", ] @@ -1997,9 +2044,11 @@ dependencies = [ name = "linkerd-metrics" version = "0.1.0" dependencies = [ + "bytes", "deflate", - "http", + "http 1.2.0", "http-body", + "http-body-util", "hyper", "linkerd-http-box", "linkerd-stack", @@ -2020,7 +2069,7 @@ name = "linkerd-opencensus" version = "0.1.0" dependencies = [ "futures", - "http", + "http 1.2.0", "http-body", "linkerd-error", "linkerd-metrics", @@ -2037,7 +2086,7 @@ name = "linkerd-opentelemetry" version = "0.1.0" dependencies = [ "futures", - "http", + "http 0.2.12", "http-body", "linkerd-error", "linkerd-metrics", @@ -2091,7 +2140,7 @@ dependencies = [ "rand", "tokio", "tokio-test", - "tower", + "tower 0.4.13", "tower-test", "tracing", ] @@ -2101,7 +2150,7 @@ name = "linkerd-proxy-api-resolve" version = "0.1.0" dependencies = [ "futures", - "http", + "http 1.2.0", "http-body", "linkerd-addr", "linkerd-error", @@ -2113,9 +2162,9 @@ dependencies = [ "linkerd-tonic-stream", "linkerd2-proxy-api", "pin-project", - "prost", + "prost 0.13.4", "tonic", - "tower", + "tower 0.4.13", "tracing", ] @@ -2133,7 +2182,7 @@ dependencies = [ "linkerd-stack", "rand", "tokio", - "tower", + "tower 0.4.13", "tracing", ] @@ -2174,7 +2223,7 @@ name = "linkerd-proxy-client-policy" version = "0.1.0" dependencies = [ "ahash", - "http", + "http 1.2.0", "ipnet", "linkerd-error", "linkerd-exp-backoff", @@ -2186,7 +2235,7 @@ dependencies = [ "linkerd2-proxy-api", "maplit", "once_cell", - "prost-types", + "prost-types 0.13.4", "quickcheck", "thiserror 2.0.11", "tonic", @@ -2198,7 +2247,7 @@ version = "0.1.0" dependencies = [ "futures", "linkerd-error", - "tower", + "tower 0.4.13", ] [[package]] @@ -2213,7 +2262,7 @@ dependencies = [ "linkerd-stack", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tracing", ] @@ -2226,7 +2275,7 @@ dependencies = [ "drain", "futures", "h2", - "http", + "http 1.2.0", "http-body", "httparse", "hyper", @@ -2254,7 +2303,7 @@ dependencies = [ "thiserror 2.0.11", "tokio", "tokio-test", - "tower", + "tower 0.4.13", "tower-test", "tracing", "try-lock", @@ -2289,7 +2338,7 @@ dependencies = [ "linkerd-proxy-core", "pin-project", "thiserror 2.0.11", - "tower", + "tower 0.4.13", "tracing", ] @@ -2298,13 +2347,13 @@ name = "linkerd-proxy-server-policy" version = "0.1.0" dependencies = [ "governor", - "http", + "http 1.2.0", "ipnet", "linkerd-http-route", "linkerd-identity", "linkerd2-proxy-api", "maplit", - "prost-types", + "prost-types 0.13.4", "quickcheck", "thiserror 2.0.11", "tokio", @@ -2328,7 +2377,7 @@ dependencies = [ "tokio", "tokio-test", "tonic", - "tower", + "tower 0.4.13", "tracing", "x509-parser", ] @@ -2339,7 +2388,7 @@ version = "0.1.0" dependencies = [ "bytes", "futures", - "http", + "http 1.2.0", "http-body", "hyper", "ipnet", @@ -2353,13 +2402,13 @@ dependencies = [ "linkerd2-proxy-api", "parking_lot", "pin-project", - "prost-types", + "prost-types 0.13.4", "quickcheck", "rand", "thiserror 2.0.11", "tokio", "tonic", - "tower", + "tower 0.4.13", "tracing", ] @@ -2375,7 +2424,7 @@ dependencies = [ "pin-project", "rand", "tokio", - "tower", + "tower 0.4.13", ] [[package]] @@ -2406,7 +2455,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-test", - "tower", + "tower 0.4.13", "tower-test", "tracing", ] @@ -2418,7 +2467,7 @@ dependencies = [ "futures", "linkerd-error", "linkerd-stack", - "tower", + "tower 0.4.13", "tracing", ] @@ -2441,7 +2490,7 @@ version = "0.1.0" dependencies = [ "bytes", "futures", - "http", + "http 1.2.0", "http-body", "linkerd-addr", "linkerd-dns-name", @@ -2453,14 +2502,14 @@ dependencies = [ "linkerd-tonic-watch", "linkerd2-proxy-api", "once_cell", - "prost-types", + "prost-types 0.13.4", "quickcheck", "regex", "thiserror 2.0.11", "tokio", "tokio-stream", "tonic", - "tower", + "tower 0.4.13", "tracing", ] @@ -2485,7 +2534,7 @@ dependencies = [ "tokio", "tokio-test", "tokio-util", - "tower", + "tower 0.4.13", "tower-test", "tracing", ] @@ -2498,7 +2547,7 @@ dependencies = [ "parking_lot", "tokio", "tokio-test", - "tower", + "tower 0.4.13", "tower-test", ] @@ -2509,7 +2558,7 @@ dependencies = [ "futures", "linkerd-error", "linkerd-stack", - "tower", + "tower 0.4.13", "tracing", ] @@ -2539,7 +2588,7 @@ dependencies = [ "pin-project", "thiserror 2.0.11", "tokio", - "tower", + "tower 0.4.13", "tracing", "untrusted", ] @@ -2600,12 +2649,12 @@ dependencies = [ "bytes", "futures", "hex", - "http", + "http 1.2.0", "linkerd-error", "linkerd-stack", "rand", "thiserror 1.0.69", - "tower", + "tower 0.4.13", "tracing", ] @@ -2635,8 +2684,8 @@ dependencies = [ "linkerd-error", "linkerd-io", "linkerd-stack", - "prost", - "prost-build", + "prost 0.13.4", + "prost-build 0.12.6", "tokio", "tokio-test", "tracing", @@ -2676,16 +2725,15 @@ dependencies = [ [[package]] name = "linkerd2-proxy-api" version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4682c00263191a5bfa4fbe64f6d80b22ff2b49aaa294da5aac062f5abc6eb9e" +source = "git+https://github.com/linkerd/linkerd2-proxy-api.git?rev=981369a18918ce5570b2d49c329eca55ae831e87#981369a18918ce5570b2d49c329eca55ae831e87" dependencies = [ "h2", - "http", + "http 1.2.0", "ipnet", - "prost", - "prost-types", + "prost 0.13.4", + "prost-types 0.13.4", "quickcheck", - "thiserror 1.0.69", + "thiserror 2.0.11", "tonic", ] @@ -2782,18 +2830,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", ] @@ -2931,8 +2970,8 @@ name = "opencensus-proto" version = "0.1.0" dependencies = [ "bytes", - "prost", - "prost-types", + "prost 0.13.4", + "prost-types 0.13.4", "tonic", "tonic-build", ] @@ -2968,7 +3007,7 @@ version = "0.1.0" dependencies = [ "opentelemetry", "opentelemetry_sdk", - "prost", + "prost 0.13.4", "tonic", "tonic-build", ] @@ -3014,7 +3053,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -3023,7 +3062,7 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "serde", ] @@ -3102,9 +3141,9 @@ dependencies = [ "nix", "once_cell", "parking_lot", - "prost", - "prost-build", - "prost-derive", + "prost 0.12.6", + "prost-build 0.12.6", + "prost-derive 0.12.6", "sha2", "smallvec", "symbolic-demangle", @@ -3146,7 +3185,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.8.0", "hex", "procfs-core", "rustix", @@ -3158,7 +3197,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.8.0", "hex", ] @@ -3192,7 +3231,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.12.6", +] + +[[package]] +name = "prost" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" +dependencies = [ + "bytes", + "prost-derive 0.13.4", ] [[package]] @@ -3203,14 +3252,34 @@ checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", "heck", - "itertools", + "itertools 0.12.1", "log", "multimap", "once_cell", "petgraph", "prettyplease", - "prost", - "prost-types", + "prost 0.12.6", + "prost-types 0.12.6", + "regex", + "syn", + "tempfile", +] + +[[package]] +name = "prost-build" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f3e5beed80eb580c68e2c600937ac2c4eedabdfd5ef1e5b7ea4f3fba84497b" +dependencies = [ + "heck", + "itertools 0.13.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost 0.13.4", + "prost-types 0.13.4", "regex", "syn", "tempfile", @@ -3223,7 +3292,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools", + "itertools 0.12.1", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-derive" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" +dependencies = [ + "anyhow", + "itertools 0.13.0", "proc-macro2", "quote", "syn", @@ -3235,7 +3317,16 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost", + "prost 0.12.6", +] + +[[package]] +name = "prost-types" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2f1e56baa61e93533aebc21af4d2134b70f66275e0fcdf3cbe43d77ff7e8fc" +dependencies = [ + "prost 0.13.4", ] [[package]] @@ -3313,11 +3404,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.8.0", ] [[package]] @@ -3328,7 +3419,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -3343,9 +3434,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -3416,11 +3507,11 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.8.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3597,8 +3688,8 @@ name = "spiffe-proto" version = "0.1.0" dependencies = [ "bytes", - "prost", - "prost-types", + "prost 0.13.4", + "prost-types 0.13.4", "tonic", "tonic-build", ] @@ -3666,9 +3757,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" [[package]] name = "synstructure" @@ -3692,7 +3783,7 @@ dependencies = [ "getrandom", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3841,16 +3932,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" version = "2.5.0" @@ -3924,26 +4005,29 @@ dependencies = [ [[package]] name = "tonic" -version = "0.10.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.21.7", + "base64 0.22.1", "bytes", "h2", - "http", + "http 1.2.0", "http-body", + "http-body-util", "hyper", "hyper-timeout", + "hyper-util", "percent-encoding", "pin-project", - "prost", + "prost 0.13.4", + "socket2", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -3951,13 +4035,14 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.10.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" +checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" dependencies = [ "prettyplease", "proc-macro2", - "prost-build", + "prost-build 0.13.4", + "prost-types 0.13.4", "quote", "syn", ] @@ -3989,6 +4074,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -4061,9 +4160,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" dependencies = [ "serde", "tracing-core", @@ -4071,9 +4170,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -4173,9 +4272,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", @@ -4184,13 +4283,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn", @@ -4199,9 +4297,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4209,9 +4307,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", @@ -4222,9 +4320,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "widestring" @@ -4269,7 +4370,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -4289,17 +4399,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -4310,9 +4421,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -4322,9 +4433,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -4334,9 +4445,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -4346,9 +4463,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -4358,9 +4475,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -4370,9 +4487,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -4382,9 +4499,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winreg" diff --git a/Cargo.toml b/Cargo.toml index 30c3d87e21..a3ba115193 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,20 +98,22 @@ lto = true [workspace.dependencies] bytes = { version = "1" } -h2 = { version = "0.3" } -http = { version = "0.2" } -http-body = { version = "0.4" } -hyper = { version = "0.14.32", default-features = false } -prost = { version = "0.12" } -prost-types = { version = "0.12" } +h2 = { version = "0.4" } +http = { version = "1" } +http-body = { version = "1" } +http-body-util = { version = "0.1" } +hyper = { version = "1", default-features = false } +hyper-util = { version = "0.1", default-features = false } +prost = { version = "0.13" } +prost-types = { version = "0.13" } tokio-rustls = { version = "0.26", default-features = false, features = [ "ring", "logging", ] } -tonic = { version = "0.10", default-features = false } -tonic-build = { version = "0.10", default-features = false } +tonic = { version = "0.12", default-features = false } +tonic-build = { version = "0.12", default-features = false } [workspace.dependencies.linkerd2-proxy-api] -version = "0.15.0" -# git = "https://github.com/linkerd/linkerd2-proxy-api.git" -# branch = "main" +git = "https://github.com/linkerd/linkerd2-proxy-api.git" +rev = "981369a18918ce5570b2d49c329eca55ae831e87" +# https://github.com/linkerd/linkerd2-proxy-api/commit/981369a18918ce5570b2d49c329eca55ae831e87 diff --git a/hyper-balance/Cargo.toml b/hyper-balance/Cargo.toml index 110d9707b1..e985266eb2 100644 --- a/hyper-balance/Cargo.toml +++ b/hyper-balance/Cargo.toml @@ -10,7 +10,7 @@ publish = false futures = { version = "0.3", default-features = false } http = { workspace = true } http-body = { workspace = true } -hyper = { workspace = true, features = ["deprecated"] } +hyper = { workspace = true } pin-project = "1" tower = { version = "0.4", default-features = false, features = ["load"] } tokio = { version = "1", features = ["macros"] } diff --git a/hyper-balance/src/lib.rs b/hyper-balance/src/lib.rs index 0fc23ca524..dbfe8eb6cb 100644 --- a/hyper-balance/src/lib.rs +++ b/hyper-balance/src/lib.rs @@ -102,32 +102,20 @@ where self.body.is_end_stream() } - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { + ) -> Poll, Self::Error>>> { let this = self.project(); - let ret = futures::ready!(this.body.poll_data(cx)); + let ret = futures::ready!(this.body.poll_frame(cx)); - // Once a data frame is received, the handle is dropped. On subsequent calls, this + // Once a frame is received, the handle is dropped. On subsequent calls, this // is a noop. drop(this.handle.take()); Poll::Ready(ret) } - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll, Self::Error>> { - let this = self.project(); - // If this is being called, the handle definitely should have been dropped - // already. - drop(this.handle.take()); - - this.body.poll_trailers(cx) - } - #[inline] fn size_hint(&self) -> hyper::body::SizeHint { self.body.size_hint() @@ -157,35 +145,21 @@ impl Body for PendingUntilEosBody { self.body.is_end_stream() } - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { + ) -> Poll, Self::Error>>> { let mut this = self.project(); let body = &mut this.body; tokio::pin!(body); - let ret = futures::ready!(body.poll_data(cx)); + let frame = futures::ready!(body.poll_frame(cx)); // If this was the last frame, then drop the handle immediately. if this.body.is_end_stream() { drop(this.handle.take()); } - Poll::Ready(ret) - } - - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll, Self::Error>> { - let this = self.project(); - let ret = futures::ready!(this.body.poll_trailers(cx)); - - // Once trailers are received, the handle is dropped immediately (in case the body - // is retained longer for some reason). - drop(this.handle.take()); - - Poll::Ready(ret) + Poll::Ready(frame) } #[inline] @@ -198,7 +172,7 @@ impl Body for PendingUntilEosBody { mod tests { use super::{PendingUntilEos, PendingUntilFirstData}; use futures::future::poll_fn; - use http_body::Body; + use http_body::{Body, Frame}; use std::collections::VecDeque; use std::io::Cursor; use std::pin::Pin; @@ -225,11 +199,13 @@ mod tests { assert_ready!(task::spawn(poll_fn(|cx| { let body = &mut body; tokio::pin!(body); - body.poll_data(cx) + body.poll_frame(cx) })) .poll()) - .expect("data some") - .expect("data ok"); + .expect("frame is some") + .expect("frame is ok") + .into_data() + .expect("frame is data"); assert!(wk.upgrade().is_none()); } @@ -282,10 +258,10 @@ mod tests { let res = assert_ready!(task::spawn(poll_fn(|cx| { let body = &mut body; tokio::pin!(body); - body.poll_data(cx) + body.poll_frame(cx) })) .poll()); - assert!(res.expect("data is some").is_err()); + assert!(res.expect("frame is some").is_err()); assert!(wk.upgrade().is_none()); } @@ -308,21 +284,21 @@ mod tests { assert_ready!(task::spawn(poll_fn(|cx| { let body = &mut body; tokio::pin!(body); - body.poll_data(cx) + body.poll_frame(cx) })) .poll()) - .expect("data some") - .expect("data ok"); + .expect("frame is some") + .expect("frame is ok"); assert!(wk.upgrade().is_some()); assert_ready!(task::spawn(poll_fn(|cx| { let body = &mut body; tokio::pin!(body); - body.poll_data(cx) + body.poll_frame(cx) })) .poll()) - .expect("data some") - .expect("data ok"); + .expect("frame is some") + .expect("frame is ok"); assert!(wk.upgrade().is_none()); } @@ -355,40 +331,42 @@ mod tests { assert_ready!(task::spawn(poll_fn(|cx| { let body = &mut body; tokio::pin!(body); - body.poll_data(cx) + body.poll_frame(cx) })) .poll()) - .expect("data") - .expect("data ok"); + .expect("frame is some") + .expect("frame is ok"); assert!(wk.upgrade().is_some()); assert_ready!(task::spawn(poll_fn(|cx| { let body = &mut body; tokio::pin!(body); - body.poll_data(cx) + body.poll_frame(cx) })) .poll()) - .expect("data") - .expect("data ok"); + .expect("frame is some") + .expect("frame is ok"); assert!(wk.upgrade().is_some()); - let poll = assert_ready!(task::spawn(poll_fn(|cx| { + assert_ready!(task::spawn(poll_fn(|cx| { let body = &mut body; tokio::pin!(body); - body.poll_data(cx) + body.poll_frame(cx) })) - .poll()); - assert!(poll.is_none()); - assert!(wk.upgrade().is_some()); + .poll()) + .expect("frame is some") + .expect("frame is ok") + .into_trailers() + .expect("is trailers"); + assert!(wk.upgrade().is_none()); - assert_ready!(task::spawn(poll_fn(|cx| { + let poll = assert_ready!(task::spawn(poll_fn(|cx| { let body = &mut body; tokio::pin!(body); - body.poll_trailers(cx) + body.poll_frame(cx) })) - .poll()) - .expect("trailers ok") - .expect("trailers"); + .poll()); + assert!(poll.is_none()); assert!(wk.upgrade().is_none()); } @@ -411,7 +389,7 @@ mod tests { let poll = assert_ready!(task::spawn(poll_fn(|cx| { let body = &mut body; tokio::pin!(body); - body.poll_data(cx) + body.poll_frame(cx) })) .poll()); assert!(poll.expect("some").is_err()); @@ -437,20 +415,21 @@ mod tests { self.0.is_empty() & self.1.is_none() } - fn poll_data( + fn poll_frame( mut self: Pin<&mut Self>, _: &mut Context<'_>, - ) -> Poll>> { - Poll::Ready(self.as_mut().0.pop_front().map(Cursor::new).map(Ok)) - } - - fn poll_trailers( - mut self: Pin<&mut Self>, - _: &mut Context<'_>, - ) -> Poll, Self::Error>> { + ) -> Poll, Self::Error>>> { let mut this = self.as_mut(); - assert!(this.0.is_empty()); - Poll::Ready(Ok(this.1.take())) + + // Return the next data frame from the sequence of chunks. + if let Some(chunk) = this.0.pop_front() { + let frame = Some(Ok(Frame::data(Cursor::new(chunk)))); + return Poll::Ready(frame); + } + + // Yield the trailers once all data frames have been yielded. + let trailers = this.1.take().map(Frame::::trailers).map(Ok); + Poll::Ready(trailers) } } @@ -464,18 +443,13 @@ mod tests { self.0.is_none() } - fn poll_data( + fn poll_frame( mut self: Pin<&mut Self>, _: &mut Context<'_>, - ) -> Poll>> { - Poll::Ready(Some(Err(self.as_mut().0.take().expect("err")))) - } + ) -> Poll, Self::Error>>> { + let err = self.as_mut().0.take().expect("err"); - fn poll_trailers( - mut self: Pin<&mut Self>, - _: &mut Context<'_>, - ) -> Poll, Self::Error>> { - Poll::Ready(Err(self.as_mut().0.take().expect("err"))) + Poll::Ready(Some(Err(err))) } } } diff --git a/linkerd/app/admin/Cargo.toml b/linkerd/app/admin/Cargo.toml index a800578bd1..c5a7dfe33b 100644 --- a/linkerd/app/admin/Cargo.toml +++ b/linkerd/app/admin/Cargo.toml @@ -19,7 +19,7 @@ bytes = { workspace = true } deflate = { version = "1", optional = true, features = ["gzip"] } http = { workspace = true } http-body = { workspace = true } -hyper = { workspace = true, features = ["deprecated", "http1", "http2"] } +hyper = { workspace = true, features = ["http1", "http2"] } futures = { version = "0.3", default-features = false } pprof = { version = "0.14", optional = true, features = ["prost-codec"] } serde = "1" diff --git a/linkerd/app/core/Cargo.toml b/linkerd/app/core/Cargo.toml index 01a57ec1c3..6a78ef1529 100644 --- a/linkerd/app/core/Cargo.toml +++ b/linkerd/app/core/Cargo.toml @@ -17,7 +17,7 @@ bytes = { workspace = true } drain = { version = "0.1", features = ["retain"] } http = { workspace = true } http-body = { workspace = true } -hyper = { workspace = true, features = ["deprecated", "http1", "http2"] } +hyper = { workspace = true, features = ["http1", "http2"] } futures = { version = "0.3", default-features = false } ipnet = "2.11" prometheus-client = "0.22" diff --git a/linkerd/app/inbound/Cargo.toml b/linkerd/app/inbound/Cargo.toml index 46d849353c..9d0d2c84ca 100644 --- a/linkerd/app/inbound/Cargo.toml +++ b/linkerd/app/inbound/Cargo.toml @@ -45,7 +45,7 @@ path = "../../proxy/server-policy" features = ["proto"] [target.'cfg(fuzzing)'.dependencies] -hyper = { workspace = true, features = ["deprecated", "http1", "http2"] } +hyper = { workspace = true, features = ["http1", "http2"] } linkerd-app-test = { path = "../test" } arbitrary = { version = "1", features = ["derive"] } libfuzzer-sys = { version = "0.4", features = ["arbitrary-derive"] } @@ -54,7 +54,7 @@ linkerd-meshtls-rustls = { path = "../../meshtls/rustls", features = [ ] } [dev-dependencies] -hyper = { workspace = true, features = ["deprecated", "http1", "http2"] } +hyper = { workspace = true, features = ["http1", "http2"] } linkerd-app-test = { path = "../test" } linkerd-http-metrics = { path = "../../http/metrics", features = ["test-util"] } linkerd-idle-cache = { path = "../../idle-cache", features = ["test-util"] } diff --git a/linkerd/app/integration/Cargo.toml b/linkerd/app/integration/Cargo.toml index 6b615ede73..93bf3547b2 100644 --- a/linkerd/app/integration/Cargo.toml +++ b/linkerd/app/integration/Cargo.toml @@ -23,11 +23,8 @@ h2 = { workspace = true } http = { workspace = true } http-body = { workspace = true } hyper = { workspace = true, features = [ - "backports", - "deprecated", "http1", "http2", - "stream", "client", "server", ] } diff --git a/linkerd/app/outbound/Cargo.toml b/linkerd/app/outbound/Cargo.toml index cfa7103d60..f7b36067a6 100644 --- a/linkerd/app/outbound/Cargo.toml +++ b/linkerd/app/outbound/Cargo.toml @@ -54,7 +54,7 @@ linkerd-tonic-watch = { path = "../../tonic-watch" } [dev-dependencies] futures-util = "0.3" http-body = { workspace = true } -hyper = { workspace = true, features = ["backports", "deprecated", "http1", "http2"] } +hyper = { workspace = true, features = ["http1", "http2"] } tokio = { version = "1", features = ["macros", "sync", "time"] } tokio-rustls = { workspace = true } tokio-test = "0.4" diff --git a/linkerd/app/test/Cargo.toml b/linkerd/app/test/Cargo.toml index a58afcef7e..babc2a38e3 100644 --- a/linkerd/app/test/Cargo.toml +++ b/linkerd/app/test/Cargo.toml @@ -17,7 +17,7 @@ futures = { version = "0.3", default-features = false } h2 = { workspace = true } http = { workspace = true } http-body = { workspace = true } -hyper = { workspace = true, features = ["deprecated", "http1", "http2"] } +hyper = { workspace = true, features = ["http1", "http2"] } linkerd-app-core = { path = "../core" } linkerd-http-route = { path = "../../http/route", optional = true } linkerd-identity = { path = "../../identity" } diff --git a/linkerd/http/box/src/body.rs b/linkerd/http/box/src/body.rs index 3693de1e36..3029748a21 100644 --- a/linkerd/http/box/src/body.rs +++ b/linkerd/http/box/src/body.rs @@ -1,5 +1,4 @@ -use http::{HeaderMap, HeaderValue}; -use http_body::Body; +use http_body::{Body, Frame}; use linkerd_error::Error; use pin_project::pin_project; use std::pin::Pin; @@ -63,19 +62,11 @@ impl Body for BoxBody { } #[inline] - fn poll_data( + fn poll_frame( mut self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { - self.as_mut().inner.as_mut().poll_data(cx) - } - - #[inline] - fn poll_trailers( - mut self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll>, Self::Error>> { - self.as_mut().inner.as_mut().poll_trailers(cx) + ) -> Poll, Self::Error>>> { + self.as_mut().inner.as_mut().poll_frame(cx) } #[inline] @@ -84,6 +75,17 @@ impl Body for BoxBody { } } +impl Data { + fn new(buf: B) -> Self + where + B: bytes::Buf + Send + 'static, + { + Self { + inner: Box::new(buf), + } + } +} + impl bytes::Buf for Data { fn remaining(&self) -> usize { self.inner.remaining() @@ -116,24 +118,16 @@ where self.0.is_end_stream() } - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { - let opt = futures::ready!(self.project().0.poll_data(cx)); - Poll::Ready(opt.map(|res| { - res.map_err(Into::into).map(|buf| Data { - inner: Box::new(buf), - }) - })) - } + ) -> Poll, Self::Error>>> { + // Poll the inner body `B` for the next frame. + let body = self.project().0; + let frame = futures::ready!(body.poll_frame(cx)); + let frame = frame.map(Self::map_frame); - #[inline] - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll>, Self::Error>> { - Poll::Ready(futures::ready!(self.project().0.poll_trailers(cx)).map_err(Into::into)) + Poll::Ready(frame) } #[inline] @@ -142,6 +136,20 @@ where } } +impl Inner +where + B: Body, + B::Data: Send + 'static, + B::Error: Into, +{ + fn map_frame(frame: Result, B::Error>) -> Result, Error> { + match frame { + Ok(f) => Ok(f.map_data(Data::new)), + Err(e) => Err(e.into()), + } + } +} + impl std::fmt::Debug for BoxBody { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("BoxBody").finish() @@ -156,20 +164,13 @@ impl Body for NoBody { true } - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, _: &mut Context<'_>, - ) -> Poll>> { + ) -> Poll, Self::Error>>> { Poll::Ready(None) } - fn poll_trailers( - self: Pin<&mut Self>, - _: &mut Context<'_>, - ) -> Poll>, Self::Error>> { - Poll::Ready(Ok(None)) - } - fn size_hint(&self) -> http_body::SizeHint { http_body::SizeHint::with_exact(0) } diff --git a/linkerd/http/classify/src/channel.rs b/linkerd/http/classify/src/channel.rs index 247e7b282b..63c4009fbd 100644 --- a/linkerd/http/classify/src/channel.rs +++ b/linkerd/http/classify/src/channel.rs @@ -1,5 +1,6 @@ use super::{ClassifyEos, ClassifyResponse}; use futures::{prelude::*, ready}; +use http_body::Frame; use linkerd_error::Error; use linkerd_stack::{layer, ExtractParam, NewService, Service}; use pin_project::{pin_project, pinned_drop}; @@ -215,40 +216,34 @@ where type Data = B::Data; type Error = B::Error; - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { + ) -> Poll, Self::Error>>> { let this = self.project(); - match ready!(this.inner.poll_data(cx)) { - None => Poll::Ready(None), - Some(Ok(data)) => Poll::Ready(Some(Ok(data))), - Some(Err(e)) => { + match ready!(this.inner.poll_frame(cx)) { + None => { + // Classify the stream if it has reached a `None`. if let Some(State { classify, tx }) = this.state.take() { - let _ = tx.try_send(classify.error(&e)); + let _ = tx.try_send(classify.eos(None)); } - Poll::Ready(Some(Err(e))) + Poll::Ready(None) } - } - } - - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll, Self::Error>> { - let this = self.project(); - match ready!(this.inner.poll_trailers(cx)) { - Ok(trls) => { - if let Some(State { classify, tx }) = this.state.take() { - let _ = tx.try_send(classify.eos(trls.as_ref())); + Some(Ok(data)) => { + // Classify the stream if this is a trailers frame. + if let trls @ Some(_) = data.trailers_ref() { + if let Some(State { classify, tx }) = this.state.take() { + let _ = tx.try_send(classify.eos(trls)); + } } - Poll::Ready(Ok(trls)) + Poll::Ready(Some(Ok(data))) } - Err(e) => { + Some(Err(e)) => { + // Classify the stream if an error has been encountered. if let Some(State { classify, tx }) = this.state.take() { let _ = tx.try_send(classify.error(&e)); } - Poll::Ready(Err(e)) + Poll::Ready(Some(Err(e))) } } } diff --git a/linkerd/http/executor/Cargo.toml b/linkerd/http/executor/Cargo.toml index ef75f18f6a..4922ed2937 100644 --- a/linkerd/http/executor/Cargo.toml +++ b/linkerd/http/executor/Cargo.toml @@ -10,6 +10,6 @@ HTTP runtime components for Linkerd. """ [dependencies] -hyper = { workspace = true, features = ["deprecated"] } +hyper = { workspace = true } tokio = { version = "1", features = ["rt"] } tracing = "0.1" diff --git a/linkerd/http/insert/src/lib.rs b/linkerd/http/insert/src/lib.rs index 21710ae0da..173fb78eb0 100644 --- a/linkerd/http/insert/src/lib.rs +++ b/linkerd/http/insert/src/lib.rs @@ -279,7 +279,7 @@ impl Future for ResponseInsertFuture where F: TryFuture>, L: Lazy, - V: Send + Sync + 'static, + V: Clone + Send + Sync + 'static, { type Output = Result; diff --git a/linkerd/http/metrics/Cargo.toml b/linkerd/http/metrics/Cargo.toml index 02c1e87a88..6ccc7e19a3 100644 --- a/linkerd/http/metrics/Cargo.toml +++ b/linkerd/http/metrics/Cargo.toml @@ -14,7 +14,7 @@ bytes = { workspace = true } futures = { version = "0.3", default-features = false } http = { workspace = true } http-body = { workspace = true } -hyper = { workspace = true, features = ["deprecated", "http1", "http2"] } +hyper = { workspace = true, features = ["http1", "http2"] } parking_lot = "0.12" pin-project = "1" tokio = { version = "1", features = ["time"] } diff --git a/linkerd/http/metrics/src/requests/service.rs b/linkerd/http/metrics/src/requests/service.rs index ad1af7ecbc..c0247aeeed 100644 --- a/linkerd/http/metrics/src/requests/service.rs +++ b/linkerd/http/metrics/src/requests/service.rs @@ -1,6 +1,6 @@ use super::{Metrics, StatusMetrics}; use futures::{ready, TryFuture}; -use http_body::Body; +use http_body::{Body, Frame}; use linkerd_error::Error; use linkerd_http_classify::{ClassifyEos, ClassifyResponse}; use linkerd_metrics::NewMetrics; @@ -266,12 +266,12 @@ where self.inner.is_end_stream() } - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { + ) -> Poll, Self::Error>>> { let this = self.project(); - let frame = ready!(this.inner.poll_data(cx)); + let frame = ready!(this.inner.poll_frame(cx)); if let Some(lock) = this.metrics.take() { let now = Instant::now(); @@ -283,13 +283,6 @@ where Poll::Ready(frame) } - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll, Self::Error>> { - self.project().inner.poll_trailers(cx) - } - #[inline] fn size_hint(&self) -> http_body::SizeHint { self.inner.size_hint() @@ -408,38 +401,46 @@ where self.inner.is_end_stream() } - fn poll_data( + fn poll_frame( mut self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { - let poll = ready!(self.as_mut().project().inner.poll_data(cx)); + ) -> Poll, Self::Error>>> { + // Poll the body for the next frame. + let poll = ready!(self.as_mut().project().inner.poll_frame(cx)); let frame = poll.map(|opt| opt.map_err(|e| self.as_mut().measure_err(e.into()))); + // Update latency metrics if we are tracking body latency. if !(*self.as_mut().project().latency_recorded) { - self.record_latency(); + self.as_mut().record_latency(); } - Poll::Ready(frame) - } - - fn poll_trailers( - mut self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll, Self::Error>> { - let trls = ready!(self.as_mut().project().inner.poll_trailers(cx)) - .map_err(|e| self.as_mut().measure_err(e.into()))?; - - if let Some(c) = self - .as_mut() - .project() - .classify - .take() - .map(|c| c.eos(trls.as_ref())) - { - self.record_class(c); + match &frame { + // Classify the stream if we have reached the end of the stream. + None => { + if let Some(classify) = self.as_mut().project().classify.take() { + let class = classify.eos(None); + self.record_class(class); + } + } + // Classify the stream if we have reached a trailers frame. + Some(Ok(frame)) => { + if let trls @ Some(_) = frame.trailers_ref() { + if let Some(classify) = self.as_mut().project().classify.take() { + let class = classify.eos(trls); + self.record_class(class); + } + } + } + // Classify the stream if we have reached an error. + Some(Err(error)) => { + if let Some(classify) = self.as_mut().project().classify.take() { + let class = classify.error(error); + self.record_class(class); + } + } } - Poll::Ready(Ok(trls)) + Poll::Ready(frame) } #[inline] diff --git a/linkerd/http/prom/src/body_data/body.rs b/linkerd/http/prom/src/body_data/body.rs index d14a895610..9c1db83500 100644 --- a/linkerd/http/prom/src/body_data/body.rs +++ b/linkerd/http/prom/src/body_data/body.rs @@ -1,6 +1,5 @@ use super::metrics::BodyDataMetrics; -use http::HeaderMap; -use http_body::SizeHint; +use http_body::{Frame, SizeHint}; use pin_project::pin_project; use std::{ pin::Pin, @@ -35,34 +34,28 @@ where type Error = B::Error; /// Attempt to pull out the next data buffer of this stream. - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { + ) -> Poll, Self::Error>>> { let this = self.project(); let inner = this.inner; let BodyDataMetrics { frame_size } = this.metrics; - let data = std::task::ready!(inner.poll_data(cx)); + let frame = std::task::ready!(inner.poll_frame(cx)); - if let Some(Ok(data)) = data.as_ref() { - // We've polled and yielded a new chunk! Increment our telemetry. - // - // NB: We're careful to call `remaining()` rather than `chunk()`, which - // "can return a shorter slice (this allows non-continuous internal representation)." - let bytes = bytes::Buf::remaining(data); - frame_size.observe(linkerd_metrics::to_f64(bytes as u64)); + if let Some(Ok(frame)) = &frame { + if let Some(data) = frame.data_ref() { + // We've polled and yielded a new chunk! Increment our telemetry. + // + // NB: We're careful to call `remaining()` rather than `chunk()`, which + // "can return a shorter slice (this allows non-continuous internal representation)." + let bytes = bytes::Buf::remaining(data); + frame_size.observe(linkerd_metrics::to_f64(bytes as u64)); + } } - Poll::Ready(data) - } - - #[inline] - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll, Self::Error>> { - self.project().inner.poll_trailers(cx) + Poll::Ready(frame) } #[inline] diff --git a/linkerd/http/prom/src/record_response.rs b/linkerd/http/prom/src/record_response.rs index 3810fd65ee..136cd82cc8 100644 --- a/linkerd/http/prom/src/record_response.rs +++ b/linkerd/http/prom/src/record_response.rs @@ -254,29 +254,27 @@ where type Data = ::Data; type Error = Error; - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { + ) -> Poll, Self::Error>>> { let mut this = self.project(); - let res = - futures::ready!(this.inner.as_mut().poll_data(cx)).map(|res| res.map_err(Into::into)); - if let Some(Err(error)) = res.as_ref() { - end_stream(this.state, Err(error)); - } else if (*this.inner).is_end_stream() { - end_stream(this.state, Ok(None)); + + // Poll the inner body for the next frame. + let poll = this.inner.as_mut().poll_frame(cx); + let frame = futures::ready!(poll).map(|res| res.map_err(Error::from)); + + match &frame { + Some(Ok(frame)) => { + if let trls @ Some(_) = frame.trailers_ref() { + end_stream(this.state, Ok(trls)); + } + } + Some(Err(error)) => end_stream(this.state, Err(error)), + None => end_stream(this.state, Ok(None)), } - Poll::Ready(res) - } - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll, Error>> { - let this = self.project(); - let res = futures::ready!(this.inner.poll_trailers(cx)).map_err(Into::into); - end_stream(this.state, res.as_ref().map(Option::as_ref)); - Poll::Ready(res) + Poll::Ready(frame) } fn is_end_stream(&self) -> bool { diff --git a/linkerd/http/prom/src/record_response/response.rs b/linkerd/http/prom/src/record_response/response.rs index d11267aa32..ff506191d7 100644 --- a/linkerd/http/prom/src/record_response/response.rs +++ b/linkerd/http/prom/src/record_response/response.rs @@ -1,3 +1,4 @@ +use http_body::Frame; use linkerd_error::Error; use linkerd_http_box::BoxBody; use linkerd_metrics::prom::Counter; @@ -150,12 +151,12 @@ where type Data = B::Data; type Error = B::Error; - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { + ) -> Poll, B::Error>>> { let mut this = self.project(); - let res = futures::ready!(this.inner.as_mut().poll_data(cx)); + let res = futures::ready!(this.inner.as_mut().poll_frame(cx)); if (*this.inner).is_end_stream() { if let Some(tx) = this.flushed.take() { let _ = tx.send(time::Instant::now()); @@ -164,18 +165,6 @@ where Poll::Ready(res) } - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll, B::Error>> { - let this = self.project(); - let res = futures::ready!(this.inner.poll_trailers(cx)); - if let Some(tx) = this.flushed.take() { - let _ = tx.send(time::Instant::now()); - } - Poll::Ready(res) - } - fn is_end_stream(&self) -> bool { self.inner.is_end_stream() } diff --git a/linkerd/http/retain/src/lib.rs b/linkerd/http/retain/src/lib.rs index fe60f2c9ea..327ed50555 100644 --- a/linkerd/http/retain/src/lib.rs +++ b/linkerd/http/retain/src/lib.rs @@ -108,19 +108,11 @@ impl http_body::Body for RetainBody { } #[inline] - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { - self.project().inner.poll_data(cx) - } - - #[inline] - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll>, B::Error>> { - self.project().inner.poll_trailers(cx) + ) -> Poll, Self::Error>>> { + self.project().inner.poll_frame(cx) } #[inline] diff --git a/linkerd/http/retry/Cargo.toml b/linkerd/http/retry/Cargo.toml index 09e15bd356..bd7655c953 100644 --- a/linkerd/http/retry/Cargo.toml +++ b/linkerd/http/retry/Cargo.toml @@ -25,6 +25,6 @@ linkerd-metrics = { path = "../../metrics" } linkerd-stack = { path = "../../stack" } [dev-dependencies] -hyper = { workspace = true, features = ["deprecated"] } +hyper = { workspace = true } linkerd-tracing = { path = "../../tracing", features = ["ansi"] } tokio = { version = "1", features = ["macros", "rt"] } diff --git a/linkerd/http/stream-timeouts/src/lib.rs b/linkerd/http/stream-timeouts/src/lib.rs index 90ffc99ea9..7d618bb5f1 100644 --- a/linkerd/http/stream-timeouts/src/lib.rs +++ b/linkerd/http/stream-timeouts/src/lib.rs @@ -3,6 +3,7 @@ //! See [`EnforceTimeouts`]. use futures::FutureExt; +use http_body::Frame; use linkerd_error::{Error, Result}; use linkerd_stack as svc; use parking_lot::RwLock; @@ -356,47 +357,31 @@ where type Data = B::Data; type Error = Error; - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { - let this = self.project(); - - if let Poll::Ready(res) = this.inner.poll_data(cx) { - if let Some(idle) = this.idle { - idle.reset(time::Instant::now()); - } - return Poll::Ready(res); - } - - if let Poll::Ready(e) = poll_body_timeout(this.deadline, this.idle, cx) { - // TODO telemetry - return Poll::Ready(Some(Err(Error::from(e)))); - } - - Poll::Pending - } - - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll, Self::Error>> { - let this = self.project(); + ) -> Poll, Self::Error>>> { + let mut this = self.project(); - if let Poll::Ready(res) = this.inner.poll_trailers(cx) { + // Poll for the next frame. + if let Poll::Ready(res) = this.inner.as_mut().poll_frame(cx) { let now = time::Instant::now(); if let Some(idle) = this.idle { idle.reset(now); } - if let Some(tx) = this.request_flushed.take() { - let _ = tx.send(now); + // Send a timestamp when the end of the stream is reached. + if this.inner.as_ref().is_end_stream() { + if let Some(tx) = this.request_flushed.take() { + let _ = tx.send(now); + } } return Poll::Ready(res); } + // Poll for a timeout error. if let Poll::Ready(e) = poll_body_timeout(this.deadline, this.idle, cx) { // TODO telemetry - return Poll::Ready(Err(Error::from(e))); + return Poll::Ready(Some(Err(Error::from(e)))); } Poll::Pending @@ -416,19 +401,22 @@ where type Data = B::Data; type Error = Error; - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { - let this = self.project(); + ) -> Poll, Self::Error>>> { + let mut this = self.project(); - if let Poll::Ready(res) = this.inner.poll_data(cx) { + // Poll for the next frame. + if let Poll::Ready(res) = this.inner.as_mut().poll_frame(cx) { + let now = time::Instant::now(); if let Some(idle) = this.idle { - idle.reset(time::Instant::now()); + idle.reset(now); } return Poll::Ready(res); } + // Poll for a timeout error. if let Poll::Ready(e) = poll_body_timeout(this.deadline, this.idle, cx) { // TODO telemetry return Poll::Ready(Some(Err(Error::from(e)))); @@ -437,27 +425,6 @@ where Poll::Pending } - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll, Self::Error>> { - let this = self.project(); - - if let Poll::Ready(res) = this.inner.poll_trailers(cx) { - if let Some(idle) = this.idle { - idle.reset(time::Instant::now()); - }; - return Poll::Ready(res); - } - - if let Poll::Ready(e) = poll_body_timeout(this.deadline, this.idle, cx) { - // TODO telemetry - return Poll::Ready(Err(Error::from(e))); - } - - Poll::Pending - } - fn is_end_stream(&self) -> bool { self.inner.is_end_stream() } diff --git a/linkerd/http/upgrade/Cargo.toml b/linkerd/http/upgrade/Cargo.toml index ceb0da30e8..ac6a736186 100644 --- a/linkerd/http/upgrade/Cargo.toml +++ b/linkerd/http/upgrade/Cargo.toml @@ -15,9 +15,10 @@ drain = "0.1" futures = { version = "0.3", default-features = false } http = { workspace = true } http-body = { workspace = true } -hyper = { workspace = true, default-features = false, features = [ - "deprecated", +hyper = { workspace = true, default-features = false, features = ["client"] } +hyper-util = { workspace = true, default-features = false, features = [ "client", + "client-legacy", ] } pin-project = "1" thiserror = "2" diff --git a/linkerd/http/upgrade/src/glue.rs b/linkerd/http/upgrade/src/glue.rs index 0b3aaadc70..28777fa5c7 100644 --- a/linkerd/http/upgrade/src/glue.rs +++ b/linkerd/http/upgrade/src/glue.rs @@ -1,7 +1,7 @@ use crate::upgrade::Http11Upgrade; use futures::{ready, TryFuture}; -use http_body::Body; -use hyper::client::connect as hyper_connect; +use http_body::{Body, Frame}; +use hyper_util::client::legacy::connect as hyper_connect; use linkerd_error::{Error, Result}; use linkerd_http_box::BoxBody; use linkerd_io::{self as io, AsyncRead, AsyncWrite}; @@ -62,38 +62,21 @@ where self.body.is_end_stream() } - fn poll_data( + fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { - // Poll the next chunk from the body. + ) -> Poll, Self::Error>>> { + // Poll the next frame from the body. let this = self.project(); let body = this.body; - let data = ready!(body.poll_data(cx)); + let frame = ready!(body.poll_frame(cx)); // Log errors. - if let Some(Err(e)) = &data { + if let Some(Err(e)) = &frame { debug!("http body error: {}", e); } - Poll::Ready(data) - } - - fn poll_trailers( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll, Self::Error>> { - // Poll the trailers from the body. - let this = self.project(); - let body = this.body; - let trailers = ready!(body.poll_trailers(cx)); - - // Log errors. - if let Err(e) = &trailers { - debug!("http trailers error: {}", e); - } - - Poll::Ready(trailers) + Poll::Ready(frame) } #[inline] @@ -240,6 +223,52 @@ where } } +impl hyper::rt::Read for Connection { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: hyper::rt::ReadBufCursor<'_>, + ) -> Poll> { + self.project().transport.poll_read(cx, buf) + } +} + +impl hyper::rt::Write for Connection { + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + self.project().transport.poll_write(cx, buf) + } + + fn poll_flush( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + self.project().transport.poll_flush(cx) + } + + fn poll_shutdown( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + self.project().transport.poll_shutdown(cx) + } + + fn is_write_vectored(&self) -> bool { + self.transport.is_write_vectored() + } + + fn poll_write_vectored( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + bufs: &[std::io::IoSlice<'_>], + ) -> Poll> { + self.project().transport.poll_write_vectored(cx, bufs) + } +} + impl hyper_connect::Connection for Connection { fn connected(&self) -> hyper_connect::Connected { hyper_connect::Connected::new().proxy(self.absolute_form) diff --git a/linkerd/http/upgrade/src/upgrade.rs b/linkerd/http/upgrade/src/upgrade.rs index 14bbc6ffa1..d729fb52a6 100644 --- a/linkerd/http/upgrade/src/upgrade.rs +++ b/linkerd/http/upgrade/src/upgrade.rs @@ -39,7 +39,7 @@ struct Http11UpgradeHalves { /// A marker type inserted into Extensions to signal it was an HTTP CONNECT /// request. -#[derive(Debug)] +#[derive(Clone, Debug)] pub struct HttpConnect; struct Inner { @@ -170,6 +170,9 @@ impl Drop for Inner { let both_upgrades = async move { let (server_conn, client_conn) = tokio::try_join!(server_upgrade, client_upgrade)?; trace!("HTTP upgrade successful"); + use hyper_util::rt::TokioIo; + let client_conn = TokioIo::new(client_conn); + let server_conn = TokioIo::new(server_conn); if let Err(e) = Duplex::new(client_conn, server_conn).await { info!("tcp duplex error: {}", e) } @@ -203,6 +206,15 @@ impl Service { } } +impl Clone for Service { + fn clone(&self) -> Self { + Self { + service: self.service.clone(), + upgrade_drain_signal: self.upgrade_drain_signal.clone(), + } + } +} + type ResponseFuture = Either, E>>>; impl tower::Service> for Service diff --git a/linkerd/metrics/Cargo.toml b/linkerd/metrics/Cargo.toml index e4d863fca4..fdaa0f98d7 100644 --- a/linkerd/metrics/Cargo.toml +++ b/linkerd/metrics/Cargo.toml @@ -13,10 +13,12 @@ stack = ["linkerd-stack"] test_util = [] [dependencies] +bytes = { workspace = true } deflate = { version = "1", features = ["gzip"] } http = { workspace = true } http-body = { workspace = true } -hyper = { workspace = true, features = ["deprecated", "http1", "http2"] } +http-body-util = { workspace = true } +hyper = { workspace = true, features = ["http1", "http2"] } linkerd-http-box = { path = "../http/box" } linkerd-stack = { path = "../stack", optional = true } linkerd-system = { path = "../system", optional = true } diff --git a/linkerd/metrics/src/serve.rs b/linkerd/metrics/src/serve.rs index 045e5d5015..ad64501c11 100644 --- a/linkerd/metrics/src/serve.rs +++ b/linkerd/metrics/src/serve.rs @@ -1,5 +1,5 @@ +use bytes::Bytes; use deflate::{write::GzEncoder, CompressionOptions}; -use linkerd_http_box::BoxBody; use std::io::Write; use tracing::trace; @@ -33,7 +33,10 @@ impl Serve { } impl Serve { - pub fn serve(&self, req: http::Request) -> std::io::Result> { + pub fn serve( + &self, + req: http::Request, + ) -> std::io::Result>> { if Self::is_gzip(&req) { trace!("gzipping metrics"); let mut writer = GzEncoder::new(Vec::::new(), CompressionOptions::fast()); @@ -41,14 +44,16 @@ impl Serve { Ok(http::Response::builder() .header(http::header::CONTENT_ENCODING, "gzip") .header(http::header::CONTENT_TYPE, "text/plain") - .body(BoxBody::new(hyper::Body::from(writer.finish()?))) + .body(http_body_util::Full::from( + writer.finish().map(Bytes::from)?, + )) .expect("Response must be valid")) } else { let mut writer = Vec::::new(); write!(&mut writer, "{}", self.metrics.as_display())?; Ok(http::Response::builder() .header(http::header::CONTENT_TYPE, "text/plain") - .body(BoxBody::new(hyper::Body::from(writer))) + .body(http_body_util::Full::from(Bytes::from(writer))) .expect("Response must be valid")) } } diff --git a/linkerd/proxy/http/Cargo.toml b/linkerd/proxy/http/Cargo.toml index cba320704a..19c3b779ea 100644 --- a/linkerd/proxy/http/Cargo.toml +++ b/linkerd/proxy/http/Cargo.toml @@ -21,14 +21,10 @@ http = { workspace = true } http-body = { workspace = true } httparse = "1" hyper = { workspace = true, features = [ - "backports", "client", - "deprecated", "http1", "http2", "server", - "stream", - "runtime", ] } hyper-balance = { path = "../../../hyper-balance" } parking_lot = "0.12" diff --git a/linkerd/proxy/tap/Cargo.toml b/linkerd/proxy/tap/Cargo.toml index 811a4f7d71..1f160c176a 100644 --- a/linkerd/proxy/tap/Cargo.toml +++ b/linkerd/proxy/tap/Cargo.toml @@ -10,7 +10,7 @@ publish = false bytes = { workspace = true } http = { workspace = true } http-body = { workspace = true } -hyper = { workspace = true, features = ["backports", "deprecated", "http1", "http2"] } +hyper = { workspace = true, features = ["http1", "http2"] } futures = { version = "0.3", default-features = false } ipnet = "2.11" linkerd2-proxy-api = { workspace = true, features = ["tap"] }