mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4d
wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
This commit is contained in:
@@ -251,7 +251,7 @@ pg_GSS_startup(PGconn *conn, int payloadlen)
|
||||
|
||||
return pg_GSS_continue(conn, payloadlen);
|
||||
}
|
||||
#endif /* ENABLE_GSS */
|
||||
#endif /* ENABLE_GSS */
|
||||
|
||||
|
||||
#ifdef ENABLE_SSPI
|
||||
@@ -477,7 +477,7 @@ pg_SSPI_startup(PGconn *conn, int use_negotiate, int payloadlen)
|
||||
|
||||
return pg_SSPI_continue(conn, payloadlen);
|
||||
}
|
||||
#endif /* ENABLE_SSPI */
|
||||
#endif /* ENABLE_SSPI */
|
||||
|
||||
/*
|
||||
* Initialize SASL authentication exchange.
|
||||
@@ -901,7 +901,7 @@ pg_fe_sendauth(AuthRequest areq, int payloadlen, PGconn *conn)
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("GSSAPI authentication not supported\n"));
|
||||
return STATUS_ERROR;
|
||||
#endif /* defined(ENABLE_GSS) || defined(ENABLE_SSPI) */
|
||||
#endif /* defined(ENABLE_GSS) || defined(ENABLE_SSPI) */
|
||||
|
||||
#ifdef ENABLE_SSPI
|
||||
case AUTH_REQ_SSPI:
|
||||
@@ -933,8 +933,8 @@ pg_fe_sendauth(AuthRequest areq, int payloadlen, PGconn *conn)
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("SSPI authentication not supported\n"));
|
||||
return STATUS_ERROR;
|
||||
#endif /* !define(ENABLE_GSSAPI) */
|
||||
#endif /* ENABLE_SSPI */
|
||||
#endif /* !define(ENABLE_GSSAPI) */
|
||||
#endif /* ENABLE_SSPI */
|
||||
|
||||
|
||||
case AUTH_REQ_CRYPT:
|
||||
|
@@ -30,4 +30,4 @@ extern void pg_fe_scram_exchange(void *opaq, char *input, int inputlen,
|
||||
bool *done, bool *success, PQExpBuffer errorMessage);
|
||||
extern char *pg_fe_scram_build_verifier(const char *password);
|
||||
|
||||
#endif /* FE_AUTH_H */
|
||||
#endif /* FE_AUTH_H */
|
||||
|
@@ -184,7 +184,7 @@ static const internalPQconninfoOption PQconninfoOptions[] = {
|
||||
offsetof(struct pg_conn, pgpassfile)},
|
||||
|
||||
{"connect_timeout", "PGCONNECT_TIMEOUT", NULL, NULL,
|
||||
"Connect-timeout", "", 10, /* strlen(INT32_MAX) == 10 */
|
||||
"Connect-timeout", "", 10, /* strlen(INT32_MAX) == 10 */
|
||||
offsetof(struct pg_conn, connect_timeout)},
|
||||
|
||||
{"dbname", "PGDATABASE", NULL, NULL,
|
||||
@@ -236,7 +236,7 @@ static const internalPQconninfoOption PQconninfoOptions[] = {
|
||||
offsetof(struct pg_conn, keepalives_idle)},
|
||||
|
||||
{"keepalives_interval", NULL, NULL, NULL,
|
||||
"TCP-Keepalives-Interval", "", 10, /* strlen(INT32_MAX) == 10 */
|
||||
"TCP-Keepalives-Interval", "", 10, /* strlen(INT32_MAX) == 10 */
|
||||
offsetof(struct pg_conn, keepalives_interval)},
|
||||
|
||||
{"keepalives_count", NULL, NULL, NULL,
|
||||
@@ -1369,7 +1369,7 @@ connectFailureMessage(PGconn *conn, int errorno)
|
||||
service);
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_UNIX_SOCKETS */
|
||||
#endif /* HAVE_UNIX_SOCKETS */
|
||||
{
|
||||
char host_addr[NI_MAXHOST];
|
||||
const char *displayed_host;
|
||||
@@ -1608,8 +1608,8 @@ setKeepalivesWin32(PGconn *conn)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif /* SIO_KEEPALIVE_VALS */
|
||||
#endif /* WIN32 */
|
||||
#endif /* SIO_KEEPALIVE_VALS */
|
||||
#endif /* WIN32 */
|
||||
|
||||
/* ----------
|
||||
* connectDBStart -
|
||||
@@ -2086,7 +2086,7 @@ keep_going: /* We will come back to here until there is
|
||||
conn->addr_cur = addr_cur->ai_next;
|
||||
continue;
|
||||
}
|
||||
#endif /* F_SETFD */
|
||||
#endif /* F_SETFD */
|
||||
|
||||
if (!IS_AF_UNIX(addr_cur->ai_family))
|
||||
{
|
||||
@@ -2124,8 +2124,8 @@ keep_going: /* We will come back to here until there is
|
||||
#ifdef SIO_KEEPALIVE_VALS
|
||||
else if (!setKeepalivesWin32(conn))
|
||||
err = 1;
|
||||
#endif /* SIO_KEEPALIVE_VALS */
|
||||
#endif /* WIN32 */
|
||||
#endif /* SIO_KEEPALIVE_VALS */
|
||||
#endif /* WIN32 */
|
||||
|
||||
if (err)
|
||||
{
|
||||
@@ -2163,7 +2163,7 @@ keep_going: /* We will come back to here until there is
|
||||
conn->sigpipe_flag = true;
|
||||
#else
|
||||
conn->sigpipe_flag = false;
|
||||
#endif /* MSG_NOSIGNAL */
|
||||
#endif /* MSG_NOSIGNAL */
|
||||
|
||||
#ifdef SO_NOSIGPIPE
|
||||
optval = 1;
|
||||
@@ -2173,7 +2173,7 @@ keep_going: /* We will come back to here until there is
|
||||
conn->sigpipe_so = true;
|
||||
conn->sigpipe_flag = false;
|
||||
}
|
||||
#endif /* SO_NOSIGPIPE */
|
||||
#endif /* SO_NOSIGPIPE */
|
||||
|
||||
/*
|
||||
* Start/make connection. This should not block, since we
|
||||
@@ -2357,7 +2357,7 @@ keep_going: /* We will come back to here until there is
|
||||
goto error_return;
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_UNIX_SOCKETS */
|
||||
#endif /* HAVE_UNIX_SOCKETS */
|
||||
|
||||
#ifdef USE_SSL
|
||||
|
||||
@@ -2394,7 +2394,7 @@ keep_going: /* We will come back to here until there is
|
||||
conn->status = CONNECTION_SSL_STARTUP;
|
||||
return PGRES_POLLING_READING;
|
||||
}
|
||||
#endif /* USE_SSL */
|
||||
#endif /* USE_SSL */
|
||||
|
||||
/*
|
||||
* Build the startup packet.
|
||||
@@ -2559,7 +2559,7 @@ keep_going: /* We will come back to here until there is
|
||||
#else /* !USE_SSL */
|
||||
/* can't get here */
|
||||
goto error_return;
|
||||
#endif /* USE_SSL */
|
||||
#endif /* USE_SSL */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2962,11 +2962,11 @@ keep_going: /* We will come back to here until there is
|
||||
case PGRES_POLLING_OK: /* Success */
|
||||
break;
|
||||
|
||||
case PGRES_POLLING_READING: /* Still going */
|
||||
case PGRES_POLLING_READING: /* Still going */
|
||||
conn->status = CONNECTION_SETENV;
|
||||
return PGRES_POLLING_READING;
|
||||
|
||||
case PGRES_POLLING_WRITING: /* Still going */
|
||||
case PGRES_POLLING_WRITING: /* Still going */
|
||||
conn->status = CONNECTION_SETENV;
|
||||
return PGRES_POLLING_WRITING;
|
||||
|
||||
@@ -3510,8 +3510,7 @@ closePGconn(PGconn *conn)
|
||||
* Close the connection, reset all transient state, flush I/O buffers.
|
||||
*/
|
||||
pqDropConnection(conn, true);
|
||||
conn->status = CONNECTION_BAD; /* Well, not really _bad_ - just
|
||||
* absent */
|
||||
conn->status = CONNECTION_BAD; /* Well, not really _bad_ - just absent */
|
||||
conn->asyncStatus = PGASYNC_IDLE;
|
||||
pqClearAsyncResult(conn); /* deallocate result */
|
||||
resetPQExpBuffer(&conn->errorMessage);
|
||||
@@ -4158,7 +4157,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
|
||||
ldap_unbind(ld);
|
||||
return 3;
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
|
||||
/* search */
|
||||
res = NULL;
|
||||
@@ -4383,7 +4382,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* USE_LDAP */
|
||||
#endif /* USE_LDAP */
|
||||
|
||||
#define MAXBUFSIZE 256
|
||||
|
||||
@@ -5412,7 +5411,7 @@ conninfo_uri_parse_options(PQconninfoOption *options, const char *uri,
|
||||
|
||||
if (prevchar == ':')
|
||||
{
|
||||
const char *port = ++p; /* advance past host terminator */
|
||||
const char *port = ++p; /* advance past host terminator */
|
||||
|
||||
while (*p && *p != '/' && *p != '?' && *p != ',')
|
||||
++p;
|
||||
@@ -5444,7 +5443,7 @@ conninfo_uri_parse_options(PQconninfoOption *options, const char *uri,
|
||||
|
||||
if (prevchar && prevchar != '?')
|
||||
{
|
||||
const char *dbname = ++p; /* advance past host terminator */
|
||||
const char *dbname = ++p; /* advance past host terminator */
|
||||
|
||||
/* Look for query parameters */
|
||||
while (*p && *p != '?')
|
||||
|
@@ -125,7 +125,7 @@ static int check_field_number(const PGresult *res, int field_num);
|
||||
*/
|
||||
|
||||
#define PGRESULT_DATA_BLOCKSIZE 2048
|
||||
#define PGRESULT_ALIGN_BOUNDARY MAXIMUM_ALIGNOF /* from configure */
|
||||
#define PGRESULT_ALIGN_BOUNDARY MAXIMUM_ALIGNOF /* from configure */
|
||||
#define PGRESULT_BLOCK_OVERHEAD Max(sizeof(PGresult_data), PGRESULT_ALIGN_BOUNDARY)
|
||||
#define PGRESULT_SEP_ALLOC_THRESHOLD (PGRESULT_DATA_BLOCKSIZE / 2)
|
||||
|
||||
@@ -3026,7 +3026,7 @@ PQcmdTuples(PGresult *res)
|
||||
while (*p && *p != ' ')
|
||||
p++;
|
||||
if (*p == 0)
|
||||
goto interpret_error; /* no space? */
|
||||
goto interpret_error; /* no space? */
|
||||
p++;
|
||||
}
|
||||
else if (strncmp(res->cmdStatus, "SELECT ", 7) == 0 ||
|
||||
|
@@ -814,7 +814,7 @@ definitelyEOF:
|
||||
definitelyFailed:
|
||||
/* Do *not* drop any already-read data; caller still wants it */
|
||||
pqDropConnection(conn, false);
|
||||
conn->status = CONNECTION_BAD; /* No more connection to backend */
|
||||
conn->status = CONNECTION_BAD; /* No more connection to backend */
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1165,7 +1165,7 @@ pqSocketPoll(int sock, int forRead, int forWrite, time_t end_time)
|
||||
|
||||
return select(sock + 1, &input_mask, &output_mask,
|
||||
&except_mask, ptr_timeout);
|
||||
#endif /* HAVE_POLL */
|
||||
#endif /* HAVE_POLL */
|
||||
}
|
||||
|
||||
|
||||
@@ -1259,4 +1259,4 @@ libpq_ngettext(const char *msgid, const char *msgid_plural, unsigned long n)
|
||||
return dngettext(PG_TEXTDOMAIN("libpq"), msgid, msgid_plural, n);
|
||||
}
|
||||
|
||||
#endif /* ENABLE_NLS */
|
||||
#endif /* ENABLE_NLS */
|
||||
|
@@ -177,7 +177,7 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
|
||||
(1 + (po->standard != 0)) >= screen_size.ws_row -
|
||||
(po->header != 0) *
|
||||
(total_line_length / screen_size.ws_col + 1) * 2
|
||||
- (po->header != 0) * 2 /* row count and newline */
|
||||
- (po->header != 0) * 2 /* row count and newline */
|
||||
)))
|
||||
{
|
||||
fout = popen(pagerenv, "w");
|
||||
@@ -190,8 +190,8 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
|
||||
sigpipe_masked = true;
|
||||
#else
|
||||
oldsigpipehandler = pqsignal(SIGPIPE, SIG_IGN);
|
||||
#endif /* ENABLE_THREAD_SAFETY */
|
||||
#endif /* WIN32 */
|
||||
#endif /* ENABLE_THREAD_SAFETY */
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
else
|
||||
fout = stdout;
|
||||
@@ -313,8 +313,8 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
|
||||
pq_reset_sigpipe(&osigset, sigpipe_pending, true);
|
||||
#else
|
||||
pqsignal(SIGPIPE, oldsigpipehandler);
|
||||
#endif /* ENABLE_THREAD_SAFETY */
|
||||
#endif /* WIN32 */
|
||||
#endif /* ENABLE_THREAD_SAFETY */
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
if (po->html3 && !po->expanded)
|
||||
fputs("</table>\n", fout);
|
||||
|
@@ -1099,7 +1099,7 @@ checkXactStatus(PGconn *conn, const char *cmdTag)
|
||||
* However, if we see one of these tags then we know for sure the server
|
||||
* is in abort state ...
|
||||
*/
|
||||
else if (strcmp(cmdTag, "*ABORT STATE*") == 0) /* pre-7.3 only */
|
||||
else if (strcmp(cmdTag, "*ABORT STATE*") == 0) /* pre-7.3 only */
|
||||
conn->xactStatus = PQTRANS_INERROR;
|
||||
}
|
||||
|
||||
@@ -1526,7 +1526,7 @@ pqFunctionCall2(PGconn *conn, Oid fnid,
|
||||
conn))
|
||||
continue;
|
||||
}
|
||||
if (pqGetc(&id, conn)) /* get the last '0' */
|
||||
if (pqGetc(&id, conn)) /* get the last '0' */
|
||||
continue;
|
||||
}
|
||||
if (id == '0')
|
||||
|
@@ -458,7 +458,7 @@ handleSyncLoss(PGconn *conn, char id, int msgLength)
|
||||
conn->asyncStatus = PGASYNC_READY; /* drop out of GetResult wait loop */
|
||||
/* flush input data since we're giving up on processing it */
|
||||
pqDropConnection(conn, true);
|
||||
conn->status = CONNECTION_BAD; /* No more connection to backend */
|
||||
conn->status = CONNECTION_BAD; /* No more connection to backend */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1679,7 +1679,7 @@ pqGetCopyData3(PGconn *conn, char **buffer, int async)
|
||||
return -2;
|
||||
}
|
||||
memcpy(*buffer, &conn->inBuffer[conn->inCursor], msgLength);
|
||||
(*buffer)[msgLength] = '\0'; /* Add terminating null */
|
||||
(*buffer)[msgLength] = '\0'; /* Add terminating null */
|
||||
|
||||
/* Mark message consumed */
|
||||
conn->inStart = conn->inCursor + msgLength;
|
||||
@@ -1915,8 +1915,8 @@ pqFunctionCall3(PGconn *conn, Oid fnid,
|
||||
|
||||
if (pqPutMsgStart('F', false, conn) < 0 || /* function call msg */
|
||||
pqPutInt(fnid, 4, conn) < 0 || /* function id */
|
||||
pqPutInt(1, 2, conn) < 0 || /* # of format codes */
|
||||
pqPutInt(1, 2, conn) < 0 || /* format code: BINARY */
|
||||
pqPutInt(1, 2, conn) < 0 || /* # of format codes */
|
||||
pqPutInt(1, 2, conn) < 0 || /* format code: BINARY */
|
||||
pqPutInt(nargs, 2, conn) < 0) /* # of args */
|
||||
{
|
||||
pqHandleSendFailure(conn);
|
||||
@@ -1951,7 +1951,7 @@ pqFunctionCall3(PGconn *conn, Oid fnid,
|
||||
}
|
||||
}
|
||||
|
||||
if (pqPutInt(1, 2, conn) < 0) /* result format code: BINARY */
|
||||
if (pqPutInt(1, 2, conn) < 0) /* result format code: BINARY */
|
||||
{
|
||||
pqHandleSendFailure(conn);
|
||||
return NULL;
|
||||
|
@@ -91,7 +91,7 @@ static pthread_mutex_t ssl_config_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_mutex_t ssl_config_mutex = NULL;
|
||||
static long win32_ssl_create_mutex = 0;
|
||||
#endif
|
||||
#endif /* ENABLE_THREAD_SAFETY */
|
||||
#endif /* ENABLE_THREAD_SAFETY */
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@@ -730,7 +730,7 @@ pq_lockingcallback(int mode, int n, const char *file, int line)
|
||||
PGTHREAD_ERROR("failed to unlock mutex");
|
||||
}
|
||||
}
|
||||
#endif /* ENABLE_THREAD_SAFETY && HAVE_CRYPTO_LOCK */
|
||||
#endif /* ENABLE_THREAD_SAFETY && HAVE_CRYPTO_LOCK */
|
||||
|
||||
/*
|
||||
* Initialize SSL library.
|
||||
@@ -809,8 +809,8 @@ pgtls_init(PGconn *conn)
|
||||
CRYPTO_set_locking_callback(pq_lockingcallback);
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_CRYPTO_LOCK */
|
||||
#endif /* ENABLE_THREAD_SAFETY */
|
||||
#endif /* HAVE_CRYPTO_LOCK */
|
||||
#endif /* ENABLE_THREAD_SAFETY */
|
||||
|
||||
if (!ssl_lib_initialized)
|
||||
{
|
||||
@@ -1142,7 +1142,7 @@ initialize_SSL(PGconn *conn)
|
||||
/* cannot return NULL because we already checked before strdup */
|
||||
engine_colon = strchr(engine_str, ':');
|
||||
|
||||
*engine_colon = '\0'; /* engine_str now has engine name */
|
||||
*engine_colon = '\0'; /* engine_str now has engine name */
|
||||
engine_colon++; /* engine_colon now has key name */
|
||||
|
||||
conn->engine = ENGINE_by_id(engine_str);
|
||||
@@ -1209,7 +1209,7 @@ initialize_SSL(PGconn *conn)
|
||||
* file */
|
||||
}
|
||||
else
|
||||
#endif /* USE_SSL_ENGINE */
|
||||
#endif /* USE_SSL_ENGINE */
|
||||
{
|
||||
/* PGSSLKEY is not an engine, treat it as a filename */
|
||||
strlcpy(fnbuf, conn->sslkey, sizeof(fnbuf));
|
||||
|
@@ -115,14 +115,14 @@ struct sigpipe_info
|
||||
if (!SIGPIPE_MASKED(conn)) \
|
||||
pqsignal(SIGPIPE, spinfo); \
|
||||
} while (0)
|
||||
#endif /* ENABLE_THREAD_SAFETY */
|
||||
#endif /* ENABLE_THREAD_SAFETY */
|
||||
#else /* WIN32 */
|
||||
|
||||
#define DECLARE_SIGPIPE_INFO(spinfo)
|
||||
#define DISABLE_SIGPIPE(conn, spinfo, failaction)
|
||||
#define REMEMBER_EPIPE(spinfo, cond)
|
||||
#define RESTORE_SIGPIPE(conn, spinfo)
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/* Procedures common to all secure sessions */
|
||||
@@ -312,7 +312,7 @@ pqsecure_raw_write(PGconn *conn, const void *ptr, size_t len)
|
||||
flags |= MSG_NOSIGNAL;
|
||||
|
||||
retry_masked:
|
||||
#endif /* MSG_NOSIGNAL */
|
||||
#endif /* MSG_NOSIGNAL */
|
||||
|
||||
DISABLE_SIGPIPE(conn, spinfo, return -1);
|
||||
|
||||
@@ -334,7 +334,7 @@ retry_masked:
|
||||
flags = 0;
|
||||
goto retry_masked;
|
||||
}
|
||||
#endif /* MSG_NOSIGNAL */
|
||||
#endif /* MSG_NOSIGNAL */
|
||||
|
||||
/* Set error message if appropriate */
|
||||
switch (result_errno)
|
||||
@@ -415,7 +415,7 @@ PQsslAttributeNames(PGconn *conn)
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* USE_SSL */
|
||||
#endif /* USE_SSL */
|
||||
|
||||
|
||||
#if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32)
|
||||
@@ -502,4 +502,4 @@ pq_reset_sigpipe(sigset_t *osigset, bool sigpipe_pending, bool got_epipe)
|
||||
SOCK_ERRNO_SET(save_errno);
|
||||
}
|
||||
|
||||
#endif /* ENABLE_THREAD_SAFETY && !WIN32 */
|
||||
#endif /* ENABLE_THREAD_SAFETY && !WIN32 */
|
||||
|
@@ -91,4 +91,4 @@ extern int PQfireResultCreateEvents(PGconn *conn, PGresult *res);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBPQ_EVENTS_H */
|
||||
#endif /* LIBPQ_EVENTS_H */
|
||||
|
@@ -56,8 +56,8 @@ typedef enum
|
||||
*/
|
||||
CONNECTION_STARTED, /* Waiting for connection to be made. */
|
||||
CONNECTION_MADE, /* Connection OK; waiting to send. */
|
||||
CONNECTION_AWAITING_RESPONSE, /* Waiting for a response from the
|
||||
* postmaster. */
|
||||
CONNECTION_AWAITING_RESPONSE, /* Waiting for a response from the
|
||||
* postmaster. */
|
||||
CONNECTION_AUTH_OK, /* Received authentication; waiting for
|
||||
* backend startup. */
|
||||
CONNECTION_SETENV, /* Negotiating environment. */
|
||||
@@ -609,4 +609,4 @@ extern int pg_valid_server_encoding_id(int encoding);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBPQ_FE_H */
|
||||
#endif /* LIBPQ_FE_H */
|
||||
|
@@ -69,7 +69,7 @@ typedef struct
|
||||
int length;
|
||||
} gss_buffer_desc;
|
||||
#endif
|
||||
#endif /* ENABLE_SSPI */
|
||||
#endif /* ENABLE_SSPI */
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
#include <openssl/ssl.h>
|
||||
@@ -78,7 +78,7 @@ typedef struct
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
#define USE_SSL_ENGINE
|
||||
#endif
|
||||
#endif /* USE_OPENSSL */
|
||||
#endif /* USE_OPENSSL */
|
||||
|
||||
/*
|
||||
* POSTGRES backend dependent Constants.
|
||||
@@ -143,7 +143,7 @@ typedef struct pgMessageField
|
||||
{
|
||||
struct pgMessageField *next; /* list link */
|
||||
char code; /* field code */
|
||||
char contents[FLEXIBLE_ARRAY_MEMBER]; /* value, nul-terminated */
|
||||
char contents[FLEXIBLE_ARRAY_MEMBER]; /* value, nul-terminated */
|
||||
} PGMessageField;
|
||||
|
||||
/* Fields needed for notice handling */
|
||||
@@ -151,7 +151,7 @@ typedef struct
|
||||
{
|
||||
PQnoticeReceiver noticeRec; /* notice message receiver */
|
||||
void *noticeRecArg;
|
||||
PQnoticeProcessor noticeProc; /* notice message processor */
|
||||
PQnoticeProcessor noticeProc; /* notice message processor */
|
||||
void *noticeProcArg;
|
||||
} PGNoticeHooks;
|
||||
|
||||
@@ -161,7 +161,7 @@ typedef struct PGEvent
|
||||
char *name; /* used only for error messages */
|
||||
void *passThrough; /* pointer supplied at registration time */
|
||||
void *data; /* optional state (instance) data */
|
||||
bool resultInitialized; /* T if RESULTCREATE/COPY succeeded */
|
||||
bool resultInitialized; /* T if RESULTCREATE/COPY succeeded */
|
||||
} PGEvent;
|
||||
|
||||
struct pg_result
|
||||
@@ -175,7 +175,7 @@ struct pg_result
|
||||
int numParameters;
|
||||
PGresParamDesc *paramDescs;
|
||||
ExecStatusType resultStatus;
|
||||
char cmdStatus[CMDSTATUS_LEN]; /* cmd status from the query */
|
||||
char cmdStatus[CMDSTATUS_LEN]; /* cmd status from the query */
|
||||
int binary; /* binary tuple values if binary == 1,
|
||||
* otherwise text */
|
||||
|
||||
@@ -255,7 +255,7 @@ typedef struct PQEnvironmentOption
|
||||
/* Typedef for parameter-status list entries */
|
||||
typedef struct pgParameterStatus
|
||||
{
|
||||
struct pgParameterStatus *next; /* list link */
|
||||
struct pgParameterStatus *next; /* list link */
|
||||
char *name; /* parameter name */
|
||||
char *value; /* parameter value */
|
||||
/* Note: name and value are stored in same malloc block as struct is */
|
||||
@@ -274,7 +274,7 @@ typedef struct pgLobjfuncs
|
||||
Oid fn_lo_tell; /* OID of backend function lo_tell */
|
||||
Oid fn_lo_tell64; /* OID of backend function lo_tell64 */
|
||||
Oid fn_lo_truncate; /* OID of backend function lo_truncate */
|
||||
Oid fn_lo_truncate64; /* OID of function lo_truncate64 */
|
||||
Oid fn_lo_truncate64; /* OID of function lo_truncate64 */
|
||||
Oid fn_lo_read; /* OID of backend function LOread */
|
||||
Oid fn_lo_write; /* OID of backend function LOwrite */
|
||||
} PGlobjfuncs;
|
||||
@@ -333,7 +333,7 @@ struct pg_conn
|
||||
char *pgtty; /* tty on which the backend messages is
|
||||
* displayed (OBSOLETE, NOT USED) */
|
||||
char *connect_timeout; /* connection timeout (numeric string) */
|
||||
char *client_encoding_initial; /* encoding to use */
|
||||
char *client_encoding_initial; /* encoding to use */
|
||||
char *pgoptions; /* options to start the backend with */
|
||||
char *appname; /* application name */
|
||||
char *fbappname; /* fallback application name */
|
||||
@@ -346,8 +346,8 @@ struct pg_conn
|
||||
char *keepalives_idle; /* time between TCP keepalives */
|
||||
char *keepalives_interval; /* time between TCP keepalive
|
||||
* retransmits */
|
||||
char *keepalives_count; /* maximum number of TCP keepalive
|
||||
* retransmits */
|
||||
char *keepalives_count; /* maximum number of TCP keepalive
|
||||
* retransmits */
|
||||
char *sslmode; /* SSL mode (require,prefer,allow,disable) */
|
||||
char *sslcompression; /* SSL compression (0 or 1) */
|
||||
char *sslkey; /* client key filename */
|
||||
@@ -380,14 +380,13 @@ struct pg_conn
|
||||
PGTransactionStatusType xactStatus; /* never changes to ACTIVE */
|
||||
PGQueryClass queryclass;
|
||||
char *last_query; /* last SQL command, or NULL if unknown */
|
||||
char last_sqlstate[6]; /* last reported SQLSTATE */
|
||||
char last_sqlstate[6]; /* last reported SQLSTATE */
|
||||
bool options_valid; /* true if OK to attempt connection */
|
||||
bool nonblocking; /* whether this connection is using nonblock
|
||||
* sending semantics */
|
||||
bool singleRowMode; /* return current query result row-by-row? */
|
||||
char copy_is_binary; /* 1 = copy binary, 0 = copy text */
|
||||
int copy_already_done; /* # bytes already returned in COPY
|
||||
* OUT */
|
||||
int copy_already_done; /* # bytes already returned in COPY OUT */
|
||||
PGnotify *notifyHead; /* oldest unreported Notify msg */
|
||||
PGnotify *notifyTail; /* newest unreported Notify msg */
|
||||
|
||||
@@ -403,8 +402,7 @@ struct pg_conn
|
||||
SockAddr raddr; /* Remote address */
|
||||
ProtocolVersion pversion; /* FE/BE protocol version in use */
|
||||
int sversion; /* server version, e.g. 70401 for 7.4.1 */
|
||||
bool auth_req_received; /* true if any type of auth req
|
||||
* received */
|
||||
bool auth_req_received; /* true if any type of auth req received */
|
||||
bool password_needed; /* true if server demanded a password */
|
||||
bool pgpassfile_used; /* true if password is from pgpassfile */
|
||||
bool sigpipe_so; /* have we masked SIGPIPE via SO_NOSIGPIPE? */
|
||||
@@ -468,8 +466,8 @@ struct pg_conn
|
||||
void *engine; /* dummy field to keep struct the same if
|
||||
* OpenSSL version changes */
|
||||
#endif
|
||||
#endif /* USE_OPENSSL */
|
||||
#endif /* USE_SSL */
|
||||
#endif /* USE_OPENSSL */
|
||||
#endif /* USE_SSL */
|
||||
|
||||
#ifdef ENABLE_GSS
|
||||
gss_ctx_id_t gctx; /* GSS context */
|
||||
@@ -489,7 +487,7 @@ struct pg_conn
|
||||
#endif
|
||||
|
||||
/* Buffer for current error message */
|
||||
PQExpBufferData errorMessage; /* expansible string */
|
||||
PQExpBufferData errorMessage; /* expansible string */
|
||||
|
||||
/* Buffer for receiving various parts of messages */
|
||||
PQExpBufferData workBuffer; /* expansible string */
|
||||
@@ -528,7 +526,7 @@ extern char *const pgresStatus[];
|
||||
#define ROOT_CRL_FILE "root.crl"
|
||||
#endif
|
||||
|
||||
#endif /* USE_SSL */
|
||||
#endif /* USE_SSL */
|
||||
|
||||
/* ----------------
|
||||
* Internal functions of libpq
|
||||
@@ -698,4 +696,4 @@ extern char *libpq_ngettext(const char *msgid, const char *msgid_plural, unsigne
|
||||
#define SOCK_ERRNO_SET(e) (errno = (e))
|
||||
#endif
|
||||
|
||||
#endif /* LIBPQ_INT_H */
|
||||
#endif /* LIBPQ_INT_H */
|
||||
|
@@ -91,7 +91,7 @@ initPQExpBuffer(PQExpBuffer str)
|
||||
str->data = (char *) malloc(INITIAL_EXPBUFFER_SIZE);
|
||||
if (str->data == NULL)
|
||||
{
|
||||
str->data = (char *) oom_buffer; /* see comment above */
|
||||
str->data = (char *) oom_buffer; /* see comment above */
|
||||
str->maxlen = 0;
|
||||
str->len = 0;
|
||||
}
|
||||
|
@@ -179,4 +179,4 @@ extern void appendPQExpBufferChar(PQExpBuffer str, char ch);
|
||||
extern void appendBinaryPQExpBuffer(PQExpBuffer str,
|
||||
const char *data, size_t datalen);
|
||||
|
||||
#endif /* PQEXPBUFFER_H */
|
||||
#endif /* PQEXPBUFFER_H */
|
||||
|
Reference in New Issue
Block a user