Skip site navigation (1) Skip section navigation (2)

pgsql: Centralize libpq's low-level code for dropping a connection.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Centralize libpq's low-level code for dropping a connection.
Date: 2012-09-07 20:02:38
Message-ID: E1TA4lC-0007Kb-0B@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Centralize libpq's low-level code for dropping a connection.

Create an internal function pqDropConnection that does the physical socket
close and cleans up closely-associated state.  This removes a bunch of ad
hoc, not always consistent closure code.  The ulterior motive is to have a
single place to wait for a spawned child backend to exit, but this seems
like good cleanup even if that never happens.

I went back and forth on whether to include "conn->status = CONNECTION_BAD"
in pqDropConnection's actions, but for the moment decided not to.  Only a
minority of the call sites actually want that, and in any case it's
arguable that conn->status is slightly higher-level state, and thus not
part of this function's purview.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/210eb9b743c0645df05e5c8be4490ba4f09fc871

Modified Files
--------------
src/interfaces/libpq/fe-connect.c   |   95 +++++++++++++----------------------
src/interfaces/libpq/fe-misc.c      |    5 +--
src/interfaces/libpq/fe-protocol3.c |    4 +-
src/interfaces/libpq/libpq-int.h    |    1 +
4 files changed, 38 insertions(+), 67 deletions(-)

pgsql-committers by date

Next:From: pgsqlDate: 2012-09-08 00:33:57
Subject: pgsql: Tag refs/tags/REL9_2_0 was created
Previous:From: Tom LaneDate: 2012-09-06 21:27:08
Subject: pgsql: Stamp 9.2.0.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group