MCPcopy Create free account
hub / github.com/apache/cloudberry / sendTerminateConn

Function sendTerminateConn

src/interfaces/libpq/fe-connect.c:4327–4346  ·  view source on GitHub ↗

* sendTerminateConn * - Send a terminate message to backend. */

Source from the content-addressed store, hash-verified

4325 * - Send a terminate message to backend.
4326 */
4327static void
4328sendTerminateConn(PGconn *conn)
4329{
4330 /*
4331 * If possible, send Terminate message to close the connection politely.
4332 *
4333 * Note that the protocol doesn't allow us to send Terminate messages
4334 * during the startup phase.
4335 */
4336 if (conn->sock != PGINVALID_SOCKET && conn->status == CONNECTION_OK)
4337 {
4338 /*
4339 * Try to send "close connection" message to backend. Ignore any
4340 * error.
4341 */
4342 pqPutMsgStart('X', conn);
4343 pqPutMsgEnd(conn);
4344 (void) pqFlush(conn);
4345 }
4346}
4347
4348/*
4349 * closePGconn

Callers 2

PQconnectPollFunction · 0.85
closePGconnFunction · 0.85

Calls 3

pqPutMsgStartFunction · 0.85
pqPutMsgEndFunction · 0.85
pqFlushFunction · 0.85

Tested by

no test coverage detected