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) |
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 |
int PQcancel | ( | PGcancel * | cancel, |
char * | errbuf, | ||
int | errbufsize | ||
) |
Definition at line 463 of file fe-cancel.c.
References SockAddr::addr, pg_cancel::be_key, pg_cancel::be_pid, buf, CANCEL_REQUEST_CODE, closesocket, connect, EINTR, pg_cancel::keepalives, pg_cancel::keepalives_count, pg_cancel::keepalives_idle, pg_cancel::keepalives_interval, optional_setsockopt(), pg_hton32, 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 171 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 65 of file fe-cancel.c.
References SockAddr::addr, pg_cancel::be_key, pg_conn::be_key, 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(), pg_conn_host::password, PGINVALID_SOCKET, pg_conn_host::port, pqConnectOptions2(), pqCopyPGconn(), pqMakeEmptyPGconn(), pqReleaseConnHosts(), pg_conn::raddr, pg_conn::sock, and pg_conn::whichhost.
Referenced by disconnectDatabase(), libpqsrv_cancel(), test_cancel(), and try_complete_step().
char* PQcancelErrorMessage | ( | const PGcancelConn * | cancelConn | ) |
Definition at line 306 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 334 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 207 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 318 of file fe-cancel.c.
References cancelConn, CONNECTION_ALLOCATED, and pqClosePGconn().
Referenced by test_cancel().
int PQcancelSocket | ( | const PGcancelConn * | cancelConn | ) |
Definition at line 294 of file fe-cancel.c.
References cancelConn, and PQsocket().
Referenced by libpqsrv_cancel(), and test_cancel().
int PQcancelStart | ( | PGcancelConn * | cancelConn | ) |
Definition at line 185 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 283 of file fe-cancel.c.
References cancelConn, and PQstatus().
Referenced by test_cancel().
void PQfreeCancel | ( | PGcancel * | cancel | ) |
Definition at line 417 of file fe-cancel.c.
References free.
Referenced by PQrequestCancel(), ResetCancelConn(), set_archive_cancel_info(), SetCancelConn(), and test_cancel().
Definition at line 349 of file fe-cancel.c.
References pg_cancel::be_key, pg_conn::be_key, pg_cancel::be_pid, pg_conn::be_pid, 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, 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 661 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().