|
1 | 1 | use crate::{http, trace_labels, Outbound}; |
2 | 2 | use linkerd_app_core::{config, errors, http_tracing, svc, Error}; |
3 | | -use tracing::debug_span; |
4 | 3 |
|
5 | | -impl<H, HSvc> Outbound<H> |
6 | | -where |
7 | | - H: svc::NewService<http::Logical, Service = HSvc> + Clone + Send + 'static, |
8 | | - HSvc: svc::Service<http::Request<http::BoxBody>, Response = http::Response<http::BoxBody>>, |
9 | | - HSvc: Send + 'static, |
10 | | - HSvc::Error: Into<Error>, |
11 | | - HSvc::Future: Send, |
12 | | -{ |
13 | | - pub fn push_http_server( |
| 4 | +impl<N> Outbound<N> { |
| 5 | + pub fn push_http_server<T, NSvc>( |
14 | 6 | self, |
15 | 7 | ) -> Outbound< |
16 | 8 | impl svc::NewService< |
17 | | - http::Logical, |
| 9 | + T, |
18 | 10 | Service = impl svc::Service< |
19 | 11 | http::Request<http::BoxBody>, |
20 | 12 | Response = http::Response<http::BoxBody>, |
21 | 13 | Error = Error, |
22 | 14 | Future = impl Send, |
23 | 15 | > + Clone, |
24 | 16 | > + Clone, |
25 | | - > { |
| 17 | + > |
| 18 | + where |
| 19 | + T: svc::Param<http::normalize_uri::DefaultAuthority>, |
| 20 | + N: svc::NewService<T, Service = NSvc> + Clone + Send + 'static, |
| 21 | + NSvc: svc::Service<http::Request<http::BoxBody>, Response = http::Response<http::BoxBody>>, |
| 22 | + NSvc: Send + 'static, |
| 23 | + NSvc::Error: Into<Error>, |
| 24 | + NSvc::Future: Send, |
| 25 | + { |
26 | 26 | let Self { |
27 | 27 | config, |
28 | 28 | runtime: rt, |
|
37 | 37 | } = config.proxy; |
38 | 38 |
|
39 | 39 | let stack = http |
40 | | - .check_new_service::<http::Logical, _>() |
| 40 | + .check_new_service::<T, _>() |
41 | 41 | .push_on_response( |
42 | 42 | svc::layers() |
43 | 43 | .push(http::BoxRequest::layer()) |
|
62 | 62 | .push(http::NewNormalizeUri::layer()) |
63 | 63 | // Record when a HTTP/1 URI originated in absolute form |
64 | 64 | .push_on_response(http::normalize_uri::MarkAbsoluteForm::layer()) |
65 | | - .instrument(|l: &http::Logical| debug_span!("http", v = %l.protocol)) |
66 | | - .check_new_service::<http::Logical, http::Request<http::BoxBody>>(); |
| 65 | + .check_new_service::<T, http::Request<http::BoxBody>>(); |
67 | 66 |
|
68 | 67 | Outbound { |
69 | 68 | config, |
|
0 commit comments