mirror of
https://github.com/YGGverse/btracker-gemini.git
synced 2026-03-31 17:15:30 +00:00
remove extra return
This commit is contained in:
parent
fea85909cd
commit
91186b8641
1 changed files with 15 additions and 16 deletions
31
src/main.rs
31
src/main.rs
|
|
@ -113,7 +113,7 @@ fn handle(
|
||||||
|
|
||||||
// header bytes received but yet could not be parsed,
|
// header bytes received but yet could not be parsed,
|
||||||
// complete with request failure
|
// complete with request failure
|
||||||
return send(
|
send(
|
||||||
&response::failure::permanent::BadRequest {
|
&response::failure::permanent::BadRequest {
|
||||||
message: Some("Bad request".to_string()),
|
message: Some("Bad request".to_string()),
|
||||||
}
|
}
|
||||||
|
|
@ -123,22 +123,20 @@ fn handle(
|
||||||
Ok(()) => warn!("Bad request from peer `{peer}`"),
|
Ok(()) => warn!("Bad request from peer `{peer}`"),
|
||||||
Err(e) => error!("Send packet to peer `{peer}` failed: {e}"),
|
Err(e) => error!("Send packet to peer `{peer}` failed: {e}"),
|
||||||
},
|
},
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => send(
|
||||||
return send(
|
&response::failure::permanent::BadRequest {
|
||||||
&response::failure::permanent::BadRequest {
|
message: Some("Bad request".to_string()),
|
||||||
message: Some("Bad request".to_string()),
|
}
|
||||||
}
|
.into_bytes(),
|
||||||
.into_bytes(),
|
&mut stream,
|
||||||
&mut stream,
|
|result| match result {
|
||||||
|result| match result {
|
Ok(()) => warn!("Send failure response to peer `{peer}`: {e}"),
|
||||||
Ok(()) => warn!("Send failure response to peer `{peer}`: {e}"),
|
Err(e) => error!("Send packet to peer `{peer}` failed: {e}"),
|
||||||
Err(e) => error!("Send packet to peer `{peer}` failed: {e}"),
|
},
|
||||||
},
|
),
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -189,7 +187,8 @@ fn response(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// try info page @TODO
|
// try info page
|
||||||
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn close(stream: &mut TlsStream<TcpStream>) -> Result<()> {
|
fn close(stream: &mut TlsStream<TcpStream>) -> Result<()> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue