File tree 2 files changed +10
-2
lines changed
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"
187
187
# Query to be sent to servers to obtain the hash used for md5 authentication. The connection will be
188
188
# established using the database configured in the pool. This parameter is inherited by every pool
189
189
# and can be redefined in pool configuration.
190
- # auth_query = "SELECT $1 "
190
+ # auth_query= "SELECT usename, passwd FROM pg_shadow WHERE usename='$1' "
191
191
192
192
# User to be used for connecting to servers to obtain the hash used for md5 authentication by sending the query
193
193
# 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(
117
117
log_client_connections : bool ,
118
118
) -> Result < ( ) , Error > {
119
119
// 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
+ } ;
121
129
122
130
match get_startup :: < TcpStream > ( & mut stream) . await {
123
131
// Client requested a TLS connection.
You can’t perform that action at this time.
0 commit comments