diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-09-07 16:02:23 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-09-07 16:02:23 -0400 |
commit | 210eb9b743c0645df05e5c8be4490ba4f09fc871 (patch) | |
tree | 8bd3c4d225a794eada3f8537f221b50fc6cafa11 /src/interfaces/libpq/libpq-int.h | |
parent | dda589c96b89320446933108ca946e7e6b8eb9d2 (diff) |
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.
Diffstat (limited to 'src/interfaces/libpq/libpq-int.h')
-rw-r--r-- | src/interfaces/libpq/libpq-int.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index 2bac59c3d87..4a6c8fedf2b 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -488,6 +488,7 @@ extern char *const pgresStatus[]; /* === in fe-connect.c === */ +extern void pqDropConnection(PGconn *conn); extern int pqPacketSend(PGconn *conn, char pack_type, const void *buf, size_t buf_len); extern bool pqGetHomeDirectory(char *buf, int bufsize); |