return false;
}
if (length == (uint32_t)-1) {
- // NULL - set an md5 password with an impossible value,
- // so that nothing will ever match
+ /*
+ * NULL - set an md5 password with an impossible value,
+ * so that nothing will ever match
+ */
password = "md5";
length = 3;
} else {
client->link->resetting = true;
sbuf_continue(&client->sbuf);
}
- // either sbuf_continue or disconnect_client could disconnect the server
- // way down in their bowels of other callbacks. so check that, and
- // return appropriately (similar to reuse_on_release)
+ /*
+ * either sbuf_continue or disconnect_client could disconnect the server
+ * way down in their bowels of other callbacks. so check that, and
+ * return appropriately (similar to reuse_on_release)
+ */
if (server->state == SV_FREE || server->state == SV_JUSTFREE)
return false;
return true;
Assert(client->state == CL_WAITING || client->state == CL_WAITING_LOGIN);
if (client->query_start == 0) {
age = now - client->request_time;
- //log_warning("query_start==0");
+ /* log_warning("query_start==0"); */
} else
age = now - client->query_start;
sa = (struct sockaddr *)&sa_un;
sa_len = sizeof(sa_un);
res = 1;
- } else if (strchr(host, ':')) { // assume IPv6 address on any : in addr
+ } else if (strchr(host, ':')) { /* assume IPv6 address on any : in addr */
slog_noise(server, "inet6 socket: %s", db->host);
memset(&sa_in6, 0, sizeof(sa_in6));
sa_in6.sin6_family = AF_INET6;
sa_in6.sin6_port = htons(db->port);
sa = (struct sockaddr *)&sa_in6;
sa_len = sizeof(sa_in6);
- } else { // else try IPv4
+ } else { /* else try IPv4 */
slog_noise(server, "inet socket: %s", db->host);
memset(&sa_in, 0, sizeof(sa_in));
sa_in.sin_family = AF_INET;
if (pool->db != db)
continue;
oldest_connection = compare_connections_by_time(oldest_connection, last_socket(&pool->idle_server_list));
- // only evict testing connections if nobody's waiting
+ /* only evict testing connections if nobody's waiting */
if (statlist_empty(&pool->waiting_client_list)) {
oldest_connection = compare_connections_by_time(oldest_connection, last_socket(&pool->used_server_list));
oldest_connection = compare_connections_by_time(oldest_connection, last_socket(&pool->tested_server_list));
allow_new:
total = database_max_connections(pool->db);
if (total > 0) {
- // try to evict unused connections first
+ /* try to evict unused connections first */
while (pool->db->connection_count >= total) {
if (!evict_connection(pool->db)) {
break;
{
AssertActive(sbuf);
Assert(sbuf->pkt_remain == 0);
- //Assert(sbuf->pkt_action == ACT_UNSET || sbuf->pkt_action == ACT_SEND || iobuf_amount_pending(&sbuf->io));
+ /* Assert(sbuf->pkt_action == ACT_UNSET || sbuf->pkt_action == ACT_SEND || iobuf_amount_pending(&sbuf->io)); */
Assert(amount > 0);
sbuf->pkt_action = ACT_SEND;
{
AssertActive(sbuf);
Assert(sbuf->pkt_remain == 0);
- //Assert(sbuf->pkt_action == ACT_UNSET || iobuf_send_pending_avail(&sbuf->io));
+ /* Assert(sbuf->pkt_action == ACT_UNSET || iobuf_send_pending_avail(&sbuf->io)); */
Assert(amount > 0);
sbuf->pkt_action = ACT_SKIP;
{
AssertActive(sbuf);
Assert(sbuf->pkt_remain == 0);
- //Assert(sbuf->pkt_action == ACT_UNSET || iobuf_send_pending_avail(&sbuf->io));
+ /* Assert(sbuf->pkt_action == ACT_UNSET || iobuf_send_pending_avail(&sbuf->io)); */
Assert(amount > 0);
sbuf->pkt_action = ACT_CALL;
PGconn *con;
bool logged_in;
- //time_t connect_time;
+ /* time_t connect_time; */
int query_count;
- //const char *query;
+ /* const char *query; */
int _arglen;
} DbConn;
switch (PQresultStatus(res)) {
case PGRES_TUPLES_OK:
- // todo: check result
+ /* todo: check result */
if (db->_arglen > 0) {
int curlen = strlen(PQgetvalue(res, 0, 0));
if (curlen != db->_arglen) {