File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ sharding_function = "pg_bigint_hash"
187187# Query to be sent to servers to obtain the hash used for md5 authentication. The connection will be
188188# established using the database configured in the pool. This parameter is inherited by every pool
189189# and can be redefined in pool configuration.
190- # auth_query = "SELECT $1 "
190+ # auth_query= "SELECT usename, passwd FROM pg_shadow WHERE usename='$1' "
191191
192192# User to be used for connecting to servers to obtain the hash used for md5 authentication by sending the query
193193# specified in `auth_query_user`. The connection will be established using the database configured in the pool.
Original file line number Diff line number Diff line change @@ -117,7 +117,15 @@ pub async fn client_entrypoint(
117117 log_client_connections : bool ,
118118) -> Result < ( ) , Error > {
119119 // Figure out if the client wants TLS or not.
120- let addr = stream. peer_addr ( ) . unwrap ( ) ;
120+ let addr = match stream. peer_addr ( ) {
121+ Ok ( addr) => addr,
122+ Err ( err) => {
123+ return Err ( Error :: SocketError ( format ! (
124+ "Failed to get peer address: {:?}" ,
125+ err
126+ ) ) ) ;
127+ }
128+ } ;
121129
122130 match get_startup :: < TcpStream > ( & mut stream) . await {
123131 // Client requested a TLS connection.
You can’t perform that action at this time.
0 commit comments