mirror of
https://github.com/cubixle/radius-rs.git
synced 2026-04-25 00:24:43 +01:00
Refactor
This commit is contained in:
@@ -62,7 +62,7 @@ impl RequestHandler<(), io::Error> for MyRequestHandler {
|
||||
info!("response => {:?} to {}", code, req.get_remote_addr());
|
||||
|
||||
conn.send_to(
|
||||
&req_packet.response(code).encode().unwrap(),
|
||||
&req_packet.make_response_packet(code).encode().unwrap(),
|
||||
req.get_remote_addr(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -70,7 +70,7 @@ impl Packet {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn response(&self, code: Code) -> Self {
|
||||
pub fn make_response_packet(&self, code: Code) -> Self {
|
||||
Packet {
|
||||
code,
|
||||
identifier: self.identifier,
|
||||
@@ -136,7 +136,7 @@ impl Packet {
|
||||
* | Attributes ...
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-
|
||||
*/
|
||||
pub fn marshal_binary(&self) -> Result<Vec<u8>, String> {
|
||||
fn marshal_binary(&self) -> Result<Vec<u8>, String> {
|
||||
let encoded_avp = match self.attributes.encode() {
|
||||
Ok(encoded) => encoded,
|
||||
Err(e) => return Err(e),
|
||||
|
||||
Reference in New Issue
Block a user