|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include <unistd.h>#include "libpq-fe.h"#include "libpq-int.h"#include "port/pg_bswap.h"
Go to the source code of this file.
Data Structures | |
| struct | pg_cancel_conn |
| struct | pg_cancel |
Functions | |
| PGcancelConn * | PQcancelCreate (PGconn *conn) |
| int | PQcancelBlocking (PGcancelConn *cancelConn) |
| int | PQcancelStart (PGcancelConn *cancelConn) |
| PostgresPollingStatusType | PQcancelPoll (PGcancelConn *cancelConn) |
| ConnStatusType | PQcancelStatus (const PGcancelConn *cancelConn) |
| int | PQcancelSocket (const PGcancelConn *cancelConn) |
| char * | PQcancelErrorMessage (const PGcancelConn *cancelConn) |
| void | PQcancelReset (PGcancelConn *cancelConn) |
| void | PQcancelFinish (PGcancelConn *cancelConn) |
| PGcancel * | PQgetCancel (PGconn *conn) |
| int | PQsendCancelRequest (PGconn *cancelConn) |
| void | PQfreeCancel (PGcancel *cancel) |
| static bool | optional_setsockopt (int fd, int protoid, int optid, int value) |
| int | PQcancel (PGcancel *cancel, char *errbuf, int errbufsize) |
| int | PQrequestCancel (PGconn *conn) |
|
static |
Definition at line 516 of file fe-cancel.c.
Referenced by PQcancel().
| int PQcancel | ( | PGcancel * | cancel, |
| char * | errbuf, | ||
| int | errbufsize | ||
| ) |
Definition at line 548 of file fe-cancel.c.
References SockAddr::addr, buf, pg_cancel::cancel_pkt_len, closesocket, connect, EINTR, pg_cancel::keepalives, pg_cancel::keepalives_count, pg_cancel::keepalives_idle, pg_cancel::keepalives_interval, optional_setsockopt(), pg_ntoh32, PGINVALID_SOCKET, pg_cancel::pgtcp_user_timeout, pg_cancel::raddr, recv, SockAddr::salen, send, SOCK_ERRNO, SOCK_ERRNO_SET, socket, strlcpy(), and val.
Referenced by DisconnectDatabase(), handle_sigint(), PQrequestCancel(), ShutdownWorkersHard(), sigTermHandler(), and test_cancel().
| int PQcancelBlocking | ( | PGcancelConn * | cancelConn | ) |
Definition at line 190 of file fe-cancel.c.
References cancelConn, PQcancelStart(), and pqConnectDBComplete().
Referenced by disconnectDatabase(), test_cancel(), and try_complete_step().
| PGcancelConn * PQcancelCreate | ( | PGconn * | conn | ) |
Definition at line 68 of file fe-cancel.c.
References SockAddr::addr, pg_conn::be_cancel_key, pg_conn::be_cancel_key_len, pg_cancel::be_pid, pg_conn::be_pid, calloc, cancelConn, conn, CONNECTION_ALLOCATED, CONNECTION_BAD, pg_conn::connhost, pg_conn_host::host, pg_conn_host::hostaddr, libpq_append_conn_error(), malloc, pg_conn_host::password, PGINVALID_SOCKET, pg_conn_host::port, pqConnectOptions2(), pqCopyPGconn(), pqMakeEmptyPGconn(), pqReleaseConnHosts(), pg_conn::pversion, pg_conn::raddr, pg_conn::sock, pg_conn_host::type, and pg_conn::whichhost.
Referenced by disconnectDatabase(), libpqsrv_cancel(), test_cancel(), and try_complete_step().
| char * PQcancelErrorMessage | ( | const PGcancelConn * | cancelConn | ) |
Definition at line 325 of file fe-cancel.c.
References cancelConn, and PQerrorMessage().
Referenced by libpqsrv_cancel(), test_cancel(), and try_complete_step().
| void PQcancelFinish | ( | PGcancelConn * | cancelConn | ) |
Definition at line 353 of file fe-cancel.c.
References cancelConn, and PQfinish().
Referenced by disconnectDatabase(), libpqsrv_cancel(), test_cancel(), and try_complete_step().
| PostgresPollingStatusType PQcancelPoll | ( | PGcancelConn * | cancelConn | ) |
Definition at line 226 of file fe-cancel.c.
References cancelConn, conn, CONNECTION_AWAITING_RESPONSE, CONNECTION_BAD, CONNECTION_OK, pg_conn::errorMessage, libpq_append_conn_error(), PGRES_POLLING_FAILED, PGRES_POLLING_OK, PGRES_POLLING_READING, PQconnectPoll(), pqReadData(), resetPQExpBuffer(), and pg_conn::status.
Referenced by libpqsrv_cancel(), pqConnectDBComplete(), and test_cancel().
| void PQcancelReset | ( | PGcancelConn * | cancelConn | ) |
Definition at line 337 of file fe-cancel.c.
References cancelConn, CONNECTION_ALLOCATED, and pqClosePGconn().
Referenced by test_cancel().
| int PQcancelSocket | ( | const PGcancelConn * | cancelConn | ) |
Definition at line 313 of file fe-cancel.c.
References cancelConn, and PQsocket().
Referenced by libpqsrv_cancel(), and test_cancel().
| int PQcancelStart | ( | PGcancelConn * | cancelConn | ) |
Definition at line 204 of file fe-cancel.c.
References cancelConn, CONNECTION_ALLOCATED, CONNECTION_BAD, libpq_append_conn_error(), and pqConnectDBStart().
Referenced by libpqsrv_cancel(), PQcancelBlocking(), and test_cancel().
| ConnStatusType PQcancelStatus | ( | const PGcancelConn * | cancelConn | ) |
Definition at line 302 of file fe-cancel.c.
References cancelConn, and PQstatus().
Referenced by test_cancel().
| void PQfreeCancel | ( | PGcancel * | cancel | ) |
Definition at line 502 of file fe-cancel.c.
References free.
Referenced by PQrequestCancel(), ResetCancelConn(), set_archive_cancel_info(), SetCancelConn(), and test_cancel().
Definition at line 368 of file fe-cancel.c.
References CancelRequestPacket::backendPID, pg_conn::be_cancel_key, pg_conn::be_cancel_key_len, pg_conn::be_pid, calloc, pg_cancel::cancel_pkt_len, pg_cancel::cancel_req, CANCEL_REQUEST_CODE, CancelRequestPacket::cancelAuthCode, CancelRequestPacket::cancelRequestCode, conn, free, pg_cancel::keepalives, pg_conn::keepalives, pg_cancel::keepalives_count, pg_conn::keepalives_count, pg_cancel::keepalives_idle, pg_conn::keepalives_idle, pg_cancel::keepalives_interval, pg_conn::keepalives_interval, malloc, pg_hton32, PGINVALID_SOCKET, pg_cancel::pgtcp_user_timeout, pg_conn::pgtcp_user_timeout, pqParseIntParam(), pg_cancel::raddr, pg_conn::raddr, and pg_conn::sock.
Referenced by PQrequestCancel(), set_archive_cancel_info(), SetCancelConn(), and test_cancel().
| int PQrequestCancel | ( | PGconn * | conn | ) |
Definition at line 752 of file fe-cancel.c.
References conn, PQExpBufferData::data, pg_conn::errorMessage, pg_conn::errorReported, PQExpBufferData::len, PQExpBufferData::maxlen, PGINVALID_SOCKET, PQcancel(), PQfreeCancel(), PQgetCancel(), pg_conn::sock, and strlcpy().
Referenced by test_cancel().
| int PQsendCancelRequest | ( | PGconn * | cancelConn | ) |
Definition at line 472 of file fe-cancel.c.
References CancelRequestPacket::backendPID, pg_cancel::be_pid, CANCEL_REQUEST_CODE, cancelConn, CancelRequestPacket::cancelRequestCode, pg_hton32, pqFlush(), pqPutMsgEnd(), pqPutMsgStart(), pqPutnchar(), STATUS_ERROR, and STATUS_OK.
Referenced by PQconnectPoll().