* sendTerminateConn * - Send a terminate message to backend. */
| 4325 | * - Send a terminate message to backend. |
| 4326 | */ |
| 4327 | static void |
| 4328 | sendTerminateConn(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 |
no test coverage detected