Skip to content

Commit

Permalink
rename upgrade fn name
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Feb 3, 2025
1 parent 2f45ac1 commit 3d41055
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/pgwire/src/pg_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ where
// If got and ssl context, say yes for ssl connection.
// Construct ssl stream and replace with current one.
self.stream.write(&BeMessage::EncryptionResponseSsl).await?;
self.stream.to_ssl(context).await?;
self.stream.upgrade_to_ssl(context).await?;
} else {
// If no, say no for encryption.
self.stream.write(&BeMessage::EncryptionResponseNo).await?;
Expand Down Expand Up @@ -1120,7 +1120,7 @@ where
S: AsyncWrite + AsyncRead + Unpin,
{
/// Convert the underlying stream to ssl stream based on the given context.
async fn to_ssl(&mut self, ssl_ctx: &SslContextRef) -> PsqlResult<()> {
async fn upgrade_to_ssl(&mut self, ssl_ctx: &SslContextRef) -> PsqlResult<()> {
let mut stream = self.stream.lock().await;

match std::mem::replace(&mut *stream, PgStreamInner::Placeholder) {
Expand Down

0 comments on commit 3d41055

Please sign in to comment.