PostgreSQL Source Code git master
|
#include "postgres.h"
#include <unistd.h>
#include "access/xlog.h"
#include "access/xlogrecovery.h"
#include "common/ip.h"
#include "common/string.h"
#include "libpq/libpq.h"
#include "libpq/libpq-be.h"
#include "libpq/pqformat.h"
#include "libpq/pqsignal.h"
#include "miscadmin.h"
#include "postmaster/postmaster.h"
#include "replication/walsender.h"
#include "storage/fd.h"
#include "storage/ipc.h"
#include "storage/procsignal.h"
#include "storage/proc.h"
#include "tcop/backend_startup.h"
#include "tcop/tcopprot.h"
#include "utils/builtins.h"
#include "utils/guc_hooks.h"
#include "utils/injection_point.h"
#include "utils/memutils.h"
#include "utils/ps_status.h"
#include "utils/timeout.h"
#include "utils/varlena.h"
Go to the source code of this file.
Functions | |
static void | BackendInitialize (ClientSocket *client_sock, CAC_state cac) |
static int | ProcessSSLStartup (Port *port) |
static int | ProcessStartupPacket (Port *port, bool ssl_done, bool gss_done) |
static void | ProcessCancelRequestPacket (Port *port, void *pkt, int pktlen) |
static void | SendNegotiateProtocolVersion (List *unrecognized_protocol_options) |
static void | process_startup_packet_die (SIGNAL_ARGS) |
static void | StartupPacketTimeoutHandler (void) |
static bool | validate_log_connections_options (List *elemlist, uint32 *flags) |
void | BackendMain (const void *startup_data, size_t startup_data_len) |
bool | check_log_connections (char **newval, void **extra, GucSource source) |
void | assign_log_connections (const char *newval, void *extra) |
Variables | |
bool | Trace_connection_negotiation = false |
uint32 | log_connections = 0 |
char * | log_connections_string = NULL |
ConnectionTiming | conn_timing = {.ready_for_use = TIMESTAMP_MINUS_INFINITY} |
void assign_log_connections | ( | const char * | newval, |
void * | extra | ||
) |
|
static |
Definition at line 141 of file backend_startup.c.
References am_walsender, appendStringInfo(), appendStringInfoString(), AuthenticationTimeout, B_WAL_SENDER, BlockSig, CAC_NOTHOTSTANDBY, CAC_OK, CAC_RECOVERY, CAC_SHUTDOWN, CAC_STARTUP, CAC_TOOMANY, check_on_shmem_exit_lists_are_empty(), ClientAuthInProgress, StringInfoData::data, DestRemote, disable_timeout(), elog, enable_timeout_after(), EnableHotStandby, ereport, errcode(), ERRCODE_CANNOT_CONNECT_NOW, errdetail(), errhint(), errmsg(), errmsg_internal(), FATAL, FrontendProtocol, gai_strerror(), GetBackendTypeDesc(), init_ps_display(), InitializeTimeouts(), initStringInfo(), INJECTION_POINT, IS_INJECTION_POINT_ATTACHED, LOG, LOG_CONNECTION_RECEIPT, log_connections, log_hostname, MemoryContextStrdup(), MemoryContextSwitchTo(), MyProcPort, pfree(), pg_getnameinfo_all(), PG_PROTOCOL, pg_usleep(), PGPROC_MAX_CACHED_SUBXIDS, port, pq_init(), pqsignal, PreAuthDelay, proc_exit(), process_startup_packet_die(), ProcessSSLStartup(), ProcessStartupPacket(), reachedConsistency, RegisterTimeout(), ReserveExternalFD(), set_ps_display(), STARTUP_PACKET_TIMEOUT, StartupBlockSig, StartupPacketTimeoutHandler(), STATUS_OK, TopMemoryContext, WARNING, and whereToSendOutput.
Referenced by BackendMain().
void BackendMain | ( | const void * | startup_data, |
size_t | startup_data_len | ||
) |
Definition at line 76 of file backend_startup.c.
References Assert(), BackendInitialize(), BackendStartupData::canAcceptConnections, Port::database_name, EnableSSL, ereport, errmsg(), InitProcess(), LoadedSSL, LOG, MemoryContextSwitchTo(), MyClientSocket, MyProcPort, PostgresMain(), secure_initialize(), TopMemoryContext, and Port::user_name.
bool check_log_connections | ( | char ** | newval, |
void ** | extra, | ||
GucSource | source | ||
) |
Definition at line 1068 of file backend_startup.c.
References GUC_check_errdetail, guc_malloc(), list_free(), LOG, newval, pfree(), pstrdup(), SplitIdentifierString(), success, and validate_log_connections_options().
|
static |
Definition at line 947 of file backend_startup.c.
Referenced by BackendInitialize().
|
static |
Definition at line 875 of file backend_startup.c.
References CancelRequestPacket::backendPID, CancelRequestPacket::cancelAuthCode, COMMERROR, ereport, errcode(), errmsg(), len, pg_ntoh32, and SendCancelRequest().
Referenced by ProcessStartupPacket().
|
static |
Definition at line 401 of file backend_startup.c.
References Assert(), COMMERROR, ereport, errcode(), errmsg(), LoadedSSL, LOG, port, pq_endmsgread(), pq_peekbyte(), pq_startmsgread(), secure_open_server(), STATUS_ERROR, STATUS_OK, and Trace_connection_negotiation.
Referenced by BackendInitialize().
|
static |
Definition at line 492 of file backend_startup.c.
References am_db_walsender, am_walsender, B_BACKEND, B_WAL_SENDER, buf, CANCEL_REQUEST_CODE, COMMERROR, EINTR, ereport, errcode(), errcode_for_socket_access(), errdetail(), errhint(), errmsg(), FATAL, FrontendProtocol, lappend(), len, LoadedSSL, LOG, MAX_STARTUP_PACKET_LENGTH, MemoryContextSwitchTo(), Min, MyBackendType, NAMEDATALEN, NEGOTIATE_GSS_CODE, NEGOTIATE_SSL_CODE, NIL, palloc(), parse_bool(), pg_clean_ascii(), pg_ntoh32, PG_PROTOCOL_EARLIEST, PG_PROTOCOL_LATEST, PG_PROTOCOL_MAJOR, PG_PROTOCOL_MINOR, port, pq_buffer_remaining_data(), pq_endmsgread(), pq_getbytes(), pq_startmsgread(), ProcessCancelRequestPacket(), ProcessStartupPacket(), pstrdup(), secure_open_gssapi(), secure_open_server(), secure_write(), SendNegotiateProtocolVersion(), STATUS_ERROR, STATUS_OK, TopMemoryContext, and Trace_connection_negotiation.
Referenced by BackendInitialize(), and ProcessStartupPacket().
|
static |
Definition at line 917 of file backend_startup.c.
References buf, FrontendProtocol, lfirst, list_length(), pq_beginmessage(), pq_endmessage(), pq_sendint32(), pq_sendstring(), and PqMsg_NegotiateProtocolVersion.
Referenced by ProcessStartupPacket().
|
static |
Definition at line 957 of file backend_startup.c.
Referenced by BackendInitialize().
Definition at line 976 of file backend_startup.c.
References GUC_check_errdetail, i, lengthof, lfirst, linitial, list_length(), LOG_CONNECTION_ALL, LOG_CONNECTION_AUTHENTICATION, LOG_CONNECTION_AUTHORIZATION, LOG_CONNECTION_ON, LOG_CONNECTION_RECEIPT, LOG_CONNECTION_SETUP_DURATIONS, option::name, next, pg_strcasecmp(), and option::val.
Referenced by check_log_connections().
ConnectionTiming conn_timing = {.ready_for_use = TIMESTAMP_MINUS_INFINITY} |
Definition at line 58 of file backend_startup.c.
Referenced by PerformAuthentication(), PostgresMain(), and postmaster_child_launch().
uint32 log_connections = 0 |
Definition at line 47 of file backend_startup.c.
Referenced by assign_log_connections(), BackendInitialize(), ClientAuthentication(), PerformAuthentication(), PostgresMain(), and set_authn_id().
char* log_connections_string = NULL |
Definition at line 48 of file backend_startup.c.
bool Trace_connection_negotiation = false |
Definition at line 46 of file backend_startup.c.
Referenced by ProcessSSLStartup(), and ProcessStartupPacket().