Changeset View
Changeset View
Standalone View
Standalone View
services/identity/src/service.rs
Show First 20 Lines • Show All 594 Lines • ▼ Show 20 Lines | struct RegistrationResponseAndPakeState { | ||||
response: RegistrationResponse, | response: RegistrationResponse, | ||||
pake_state: ServerRegistration<Cipher>, | pake_state: ServerRegistration<Cipher>, | ||||
} | } | ||||
struct LoginResponseAndPakeState { | struct LoginResponseAndPakeState { | ||||
response: PakeLoginResponseStruct, | response: PakeLoginResponseStruct, | ||||
pake_state: ServerLogin<Cipher>, | pake_state: ServerLogin<Cipher>, | ||||
} | } | ||||
async fn send_to_client<T>( | |||||
tx: &tokio::sync::mpsc::Sender<Result<T, Status>>, | |||||
response: Result<T, Status>, | |||||
) -> Result<(), Status> { | |||||
let transport_result = match response { | |||||
Ok(message) => tx.send(Ok(message)).await, | |||||
Err(status) => { | |||||
error!("{}", status.message()); | |||||
tx.send(Err(status)).await | |||||
} | |||||
}; | |||||
transport_result.map_err(|_| Status::internal("disconnection")) | |||||
} |