-
- Downloads
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.
Showing
- src/interfaces/libpq/fe-connect.c 35 additions, 60 deletionssrc/interfaces/libpq/fe-connect.c
- src/interfaces/libpq/fe-misc.c 1 addition, 4 deletionssrc/interfaces/libpq/fe-misc.c
- src/interfaces/libpq/fe-protocol3.c 1 addition, 3 deletionssrc/interfaces/libpq/fe-protocol3.c
- src/interfaces/libpq/libpq-int.h 1 addition, 0 deletionssrc/interfaces/libpq/libpq-int.h
Loading
Please register or sign in to comment