PostgreSQL Source Code git master
|
#include "postgres.h"
#include <unistd.h>
#include "access/xlog.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/injection_point.h"
#include "utils/memutils.h"
#include "utils/ps_status.h"
#include "utils/timeout.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 | SendNegotiateProtocolVersion (List *unrecognized_protocol_options) |
static void | process_startup_packet_die (SIGNAL_ARGS) |
static void | StartupPacketTimeoutHandler (void) |
void | BackendMain (char *startup_data, size_t startup_data_len) |
Variables | |
bool | Trace_connection_negotiation = false |
|
static |
Definition at line 124 of file backend_startup.c.
References am_walsender, appendStringInfo(), appendStringInfoString(), AuthenticationTimeout, B_WAL_SENDER, BlockSig, CAC_NOTCONSISTENT, 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(), errmsg(), errmsg_internal(), FATAL, FrontendProtocol, gai_strerror(), GetBackendTypeDesc(), init_ps_display(), InitializeTimeouts(), initStringInfo(), INJECTION_POINT, IS_INJECTION_POINT_ATTACHED, LOG, Log_connections, log_hostname, MemoryContextStrdup(), MemoryContextSwitchTo(), MyProcPort, pfree(), pg_getnameinfo_all(), PG_PROTOCOL, pg_usleep(), port, pq_init(), pqsignal(), PreAuthDelay, proc_exit(), process_startup_packet_die(), ProcessSSLStartup(), ProcessStartupPacket(), RegisterTimeout(), ReserveExternalFD(), set_ps_display(), STARTUP_PACKET_TIMEOUT, StartupBlockSig, StartupPacketTimeoutHandler(), STATUS_OK, TopMemoryContext, WARNING, and whereToSendOutput.
Referenced by BackendMain().
void BackendMain | ( | char * | startup_data, |
size_t | startup_data_len | ||
) |
Definition at line 59 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.
|
static |
Definition at line 913 of file backend_startup.c.
Referenced by BackendInitialize().
|
static |
Definition at line 377 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 468 of file backend_startup.c.
References am_db_walsender, am_walsender, B_BACKEND, B_WAL_SENDER, CancelRequestPacket::backendPID, buf, CANCEL_REQUEST_CODE, CancelRequestPacket::cancelAuthCode, 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(), ProcessStartupPacket(), pstrdup(), secure_open_gssapi(), secure_open_server(), secure_write(), SendCancelRequest(), SendNegotiateProtocolVersion(), STATUS_ERROR, STATUS_OK, TopMemoryContext, and Trace_connection_negotiation.
Referenced by BackendInitialize(), and ProcessStartupPacket().
|
static |
Definition at line 883 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 923 of file backend_startup.c.
Referenced by BackendInitialize().
bool Trace_connection_negotiation = false |
Definition at line 43 of file backend_startup.c.
Referenced by ProcessSSLStartup(), and ProcessStartupPacket().