Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ paste = "1.0"
percent-encoding = "2.3"
petgraph = { version = "0.6.5", default-features = false }
pin-project-lite = "0.2.9"
pgwire = { version = "0.34.1", default-features = false, features = ["server-api", "pg-ext-types"] }
pgwire = { version = "0.34.2", default-features = false, features = ["server-api", "pg-ext-types"] }
postgres-types = "0.2.5"
pretty_assertions = { version = "1.4", features = ["unstable"] }
proc-macro2 = "1.0"
Expand Down
8 changes: 6 additions & 2 deletions crates/pg/src/pg_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use futures::{stream, Sink};
use futures::{SinkExt, Stream};
use http::StatusCode;
use pgwire::api::auth::{
finish_authentication, save_startup_parameters_to_metadata, DefaultServerParameterProvider, LoginInfo,
StartupHandler,
finish_authentication, protocol_negotiation, save_startup_parameters_to_metadata, DefaultServerParameterProvider,
LoginInfo, StartupHandler,
};
use pgwire::api::portal::Format;
use pgwire::api::query::SimpleQueryHandler;
Expand Down Expand Up @@ -217,6 +217,7 @@ impl<T: Sync + Send + ControlStateReadAccess + ControlStateWriteAccess + NodeDel
{
match message {
PgWireFrontendMessage::Startup(ref startup) => {
protocol_negotiation(client, startup).await?;
save_startup_parameters_to_metadata(client, startup);
client.set_state(PgWireConnectionState::AuthenticationInProgress);

Expand Down Expand Up @@ -281,6 +282,9 @@ impl<T: Sync + Send + ControlStateReadAccess + ControlStateWriteAccess + NodeDel
finish_authentication(client, &self.parameter_provider).await?;
}
// The other messages are for features not supported by SpacetimeDB, that are rejected by the parser.
// This includes TLS negotiation - any TLS negotiation done with the client will happen before
// this point, and because we pass `tls_acceptor: None` for `process_socket()`, pgwire will reject
// TLS for us.
_ => {
unreachable!("Unsupported startup message: {message:?}");
}
Expand Down
Loading