diff --git a/mysql/src/lib.rs b/mysql/src/lib.rs index b9d1ec2..3993f6a 100644 --- a/mysql/src/lib.rs +++ b/mysql/src/lib.rs @@ -316,7 +316,7 @@ pub trait AsyncMysqlShim { } /// authenticate method for the specified plugin - fn authenticate( + async fn authenticate( &self, _auth_plugin: &str, _username: &[u8], @@ -806,7 +806,7 @@ pub struct AsyncMysqlIntermediary { writer: packet::PacketWriter>>, } -impl>> + Send, S: AsyncRead + AsyncWrite + Unpin> +impl>> + Send + Sync, S: AsyncRead + AsyncWrite + Unpin> AsyncMysqlIntermediary { /// Create a new server over two one-way channels and process client commands until the client @@ -976,12 +976,16 @@ impl>> + Send, S: AsyncRead + AsyncWrite + Unpi self.writer.set_seq(seq + 1); - if !self.shim.authenticate( - auth_plugin_expect, - &handshake.username, - &scramble, - auth_response.as_slice(), - ) { + if !self + .shim + .authenticate( + auth_plugin_expect, + &handshake.username, + &scramble, + auth_response.as_slice(), + ) + .await + { let err_msg = format!( "Authenticate failed, user: {:?}, auth_plugin: {:?}", String::from_utf8_lossy(&handshake.username),