Skip to content

Commit 0bc41d8

Browse files
committed
Expose conection.stream
That way our proxy can take back stream for proxying.
1 parent 43e6db2 commit 0bc41d8

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

tokio-postgres/src/connection.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ enum State {
4949
/// occurred, or because its associated `Client` has dropped and all outstanding work has completed.
5050
#[must_use = "futures do nothing unless polled"]
5151
pub struct Connection<S, T> {
52-
stream: Framed<MaybeTlsStream<S, T>, PostgresCodec>,
52+
/// HACK: we need this in the Neon Proxy.
53+
pub stream: Framed<MaybeTlsStream<S, T>, PostgresCodec>,
5354
/// HACK: we need this in the Neon Proxy to forward params.
5455
pub parameters: HashMap<String, String>,
5556
receiver: mpsc::UnboundedReceiver<Request>,

tokio-postgres/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ mod copy_out;
165165
pub mod error;
166166
mod generic_client;
167167
mod keepalive;
168-
mod maybe_tls_stream;
168+
pub mod maybe_tls_stream;
169169
mod portal;
170170
mod prepare;
171171
mod query;

tokio-postgres/src/maybe_tls_stream.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
//! MaybeTlsStream.
2+
//!
3+
//! Represents a stream that may or may not be encrypted with TLS.
14
use crate::tls::{ChannelBinding, TlsStream};
25
use std::io;
36
use std::pin::Pin;
47
use std::task::{Context, Poll};
58
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
69

10+
/// A stream that may or may not be encrypted with TLS.
711
pub enum MaybeTlsStream<S, T> {
12+
/// An unencrypted stream.
813
Raw(S),
14+
/// An encrypted stream.
915
Tls(T),
1016
}
1117

0 commit comments

Comments
 (0)