mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-31 00:00:10 +02:00
checkpoint
This commit is contained in:
@@ -39,7 +39,8 @@ async fn main() {
|
||||
|
||||
let mut app = Router::new()
|
||||
.route("/", get(handler))
|
||||
.into_make_service_with_connect_info::<SocketAddr, _>();
|
||||
.into_make_service()
|
||||
.with_connect_info::<SocketAddr, _>();
|
||||
|
||||
loop {
|
||||
let stream = poll_fn(|cx| Pin::new(&mut listener).poll_accept(cx))
|
||||
|
||||
@@ -55,7 +55,10 @@ async fn main() {
|
||||
let app = Router::new().route("/", get(handler));
|
||||
|
||||
axum::Server::builder(ServerAccept { uds })
|
||||
.serve(app.into_make_service_with_connect_info::<UdsConnectInfo, _>())
|
||||
.serve(
|
||||
app.into_make_service()
|
||||
.with_connect_info::<UdsConnectInfo, _>(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
});
|
||||
@@ -156,7 +159,7 @@ struct UdsConnectInfo {
|
||||
}
|
||||
|
||||
impl connect_info::Connected<&UnixStream> for UdsConnectInfo {
|
||||
fn connect_info(target: &UnixStream) -> Self {
|
||||
fn connect_info(target: &&UnixStream) -> Self {
|
||||
let peer_addr = target.peer_addr().unwrap();
|
||||
let peer_cred = target.peer_cred().unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user