From 20355cb5f05086590469b14bd68848bce5bf4b82 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Tue, 22 Jul 2025 21:51:03 +0100 Subject: [PATCH] fix rest.rs --- proxy/src/serverless/backend.rs | 11 +++++++++-- proxy/src/serverless/rest.rs | 10 +++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/proxy/src/serverless/backend.rs b/proxy/src/serverless/backend.rs index 6f2c32eba9..31df7eb9f1 100644 --- a/proxy/src/serverless/backend.rs +++ b/proxy/src/serverless/backend.rs @@ -40,7 +40,8 @@ use crate::rate_limiter::EndpointRateLimiter; use crate::types::{EndpointId, Host, LOCAL_PROXY_SUFFIX}; pub(crate) struct PoolingBackend { - pub(crate) http_conn_pool: Arc>>, + pub(crate) http_conn_pool: + Arc>>, pub(crate) local_pool: Arc>, pub(crate) pool: Arc>>, @@ -632,7 +633,13 @@ async fn connect_http2( port: u16, timeout: Duration, tls: Option<&Arc>, -) -> Result<(http_conn_pool::LocalProxyClient, http_conn_pool::LocalProxyConnection), LocalProxyConnError> { +) -> Result< + ( + http_conn_pool::LocalProxyClient, + http_conn_pool::LocalProxyConnection, + ), + LocalProxyConnError, +> { let addrs = match host_addr { Some(addr) => vec![SocketAddr::new(addr, port)], None => lookup_host((host, port)) diff --git a/proxy/src/serverless/rest.rs b/proxy/src/serverless/rest.rs index 173c2629f7..c9b5e99747 100644 --- a/proxy/src/serverless/rest.rs +++ b/proxy/src/serverless/rest.rs @@ -46,7 +46,7 @@ use super::backend::{HttpConnError, LocalProxyConnError, PoolingBackend}; use super::conn_pool::AuthData; use super::conn_pool_lib::ConnInfo; use super::error::{ConnInfoError, Credentials, HttpCodeError, ReadPayloadError}; -use super::http_conn_pool::{self, Send}; +use super::http_conn_pool::{self, LocalProxyClient}; use super::http_util::{ ALLOW_POOL, CONN_STRING, NEON_REQUEST_ID, RAW_TEXT_OUTPUT, TXN_ISOLATION_LEVEL, TXN_READ_ONLY, get_conn_info, json_response, uuid_to_header_value, @@ -145,7 +145,7 @@ impl DbSchemaCache { endpoint_id: &EndpointCacheKey, auth_header: &HeaderValue, connection_string: &str, - client: &mut http_conn_pool::Client, + client: &mut http_conn_pool::Client, ctx: &RequestContext, config: &'static ProxyConfig, ) -> Result, RestError> { @@ -190,7 +190,7 @@ impl DbSchemaCache { &self, auth_header: &HeaderValue, connection_string: &str, - client: &mut http_conn_pool::Client, + client: &mut http_conn_pool::Client, ctx: &RequestContext, config: &'static ProxyConfig, ) -> Result<(ApiConfig, DbSchemaOwned), RestError> { @@ -430,7 +430,7 @@ struct BatchQueryData<'a> { } async fn make_local_proxy_request( - client: &mut http_conn_pool::Client, + client: &mut http_conn_pool::Client, headers: impl IntoIterator, body: QueryData<'_>, max_len: usize, @@ -461,7 +461,7 @@ async fn make_local_proxy_request( } async fn make_raw_local_proxy_request( - client: &mut http_conn_pool::Client, + client: &mut http_conn_pool::Client, headers: impl IntoIterator, body: String, ) -> Result, RestError> {