From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Move initialization of the Port struct to the child process
Date: Tue, 12 Mar 2024 11:45:23 +0000
Message-ID: <E1rk0ZO-003Pk0-Rz@gemulon.postgresql.org> (raw)
Move initialization of the Port struct to the child process
In postmaster, use a more lightweight ClientSocket struct that
encapsulates just the socket itself and the remote endpoint's address
that you get from accept() call. ClientSocket is passed to the child
process, which initializes the bigger Port struct. This makes it more
clear what information postmaster initializes, and what is left to the
child process.
Rename the StreamServerPort and StreamConnection functions to make it
more clear what they do. Remove StreamClose, replacing it with plain
closesocket() calls.
Reviewed-by: Tristan Partin, Andres Freund
Discussion: https://www.postgresql.org/message-id/7a59b073-5b5b-151e-7ed3-8b01ff7ce9ef@iki.fi
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/4945e4ed4a72c3ff41560ccef722c3d70ae07dbb
Modified Files
--------------
src/backend/libpq/pqcomm.c | 65 ++++------
src/backend/postmaster/postmaster.c | 229 +++++++++++++++---------------------
src/backend/tcop/postgres.c | 5 +-
src/include/libpq/libpq-be.h | 20 +++-
src/include/libpq/libpq.h | 7 +-
src/tools/pgindent/typedefs.list | 1 +
6 files changed, 142 insertions(+), 185 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Move initialization of the Port struct to the child process
In-Reply-To: <E1rk0ZO-003Pk0-Rz@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox