This commit is contained in:
moznion
2020-11-28 15:40:31 +09:00
parent 2d2069b0ab
commit dc1fbe85ad
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ impl RequestHandler<(), io::Error> for MyRequestHandler {
info!("response => {:?} to {}", code, req.get_remote_addr()); info!("response => {:?} to {}", code, req.get_remote_addr());
conn.send_to( conn.send_to(
&req_packet.response(code).encode().unwrap(), &req_packet.make_response_packet(code).encode().unwrap(),
req.get_remote_addr(), req.get_remote_addr(),
) )
.await?; .await?;
+2 -2
View File
@@ -70,7 +70,7 @@ impl Packet {
}) })
} }
pub fn response(&self, code: Code) -> Self { pub fn make_response_packet(&self, code: Code) -> Self {
Packet { Packet {
code, code,
identifier: self.identifier, identifier: self.identifier,
@@ -136,7 +136,7 @@ impl Packet {
* | Attributes ... * | 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() { let encoded_avp = match self.attributes.encode() {
Ok(encoded) => encoded, Ok(encoded) => encoded,
Err(e) => return Err(e), Err(e) => return Err(e),