Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
roshan0708 committed Dec 18, 2024
1 parent 989f276 commit 86bbfec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/backend/postmaster/postmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ ProtocolExtensionConfig default_protocol_config = {
NULL, NULL, NULL, NULL, /* use libpq defaults for printtup*() */
NULL,
libpq_report_param_status,
libpq_ssl_handshake
libpq_direct_ssl_handshake
};

/* still more option variables */
Expand Down Expand Up @@ -1513,9 +1513,9 @@ libpq_end_command(QueryCompletion *qc, CommandDest dest)
}

int
libpq_ssl_handshake(struct Port *port)
libpq_direct_ssl_handshake(struct Port *port)
{
return WrapperProcessSSLStartup(port);
return ProcessSSLStartup(port);
}

/*
Expand Down
13 changes: 2 additions & 11 deletions src/backend/tcop/backend_startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
bool Trace_connection_negotiation = false;
static void BackendInitialize(ClientSocket *client_sock, CAC_state cac, ProtocolExtensionConfig *protocol_config);
int ProcessStartupPacket(Port *port, bool ssl_done, bool gss_done);
static int ProcessSSLStartup(Port *port);
int ProcessSSLStartup(Port *port);
static void SendNegotiateProtocolVersion(List *unrecognized_protocol_options);
static void process_startup_packet_die(SIGNAL_ARGS);
static void StartupPacketTimeoutHandler(void);
Expand Down Expand Up @@ -359,7 +359,7 @@ BackendInitialize(ClientSocket *client_sock, CAC_state cac, ProtocolExtensionCon
* This happens before the startup packet so we are careful not to actually
* read any bytes from the stream if it's not a direct SSL connection.
*/
static int
int
ProcessSSLStartup(Port *port)
{
int firstbyte;
Expand Down Expand Up @@ -888,12 +888,3 @@ StartupPacketTimeoutHandler(void)
{
_exit(1);
}

/*
* Wrapper for ProcessSSLStartup to handle direct SSL handshake
*/
int
WrapperProcessSSLStartup(Port *port)
{
return ProcessSSLStartup(port);
}
2 changes: 1 addition & 1 deletion src/include/postmaster/protocol_extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ extern void libpq_send_ready_for_query(CommandDest dest);
extern int libpq_read_command(StringInfo inBuf);
extern void libpq_end_command(QueryCompletion *qc, CommandDest dest);
extern void libpq_report_param_status(const char *name, char *val);
extern int libpq_ssl_handshake(struct Port *port);
extern int libpq_direct_ssl_handshake(struct Port *port);

#endif /* _PROTOCOL_EXTENSION_H */
2 changes: 1 addition & 1 deletion src/include/tcop/backend_startup.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ typedef struct BackendStartupData

extern void BackendMain(char *startup_data, size_t startup_data_len) pg_attribute_noreturn();
extern int ProcessStartupPacket(Port *port, bool ssl_done, bool gss_done);
extern int WrapperProcessSSLStartup(Port *port);
extern int ProcessSSLStartup(Port *port);

#endif /* BACKEND_STARTUP_H */

0 comments on commit 86bbfec

Please sign in to comment.