]> granicus.if.org Git - pgbouncer/commitdiff
Replace C++ comments.
authorEuler Taveira de Oliveira <euler@timbira.com>
Wed, 18 Dec 2013 23:33:31 +0000 (20:33 -0300)
committerEuler Taveira de Oliveira <euler@timbira.com>
Wed, 18 Dec 2013 23:33:31 +0000 (20:33 -0300)
src/client.c
src/janitor.c
src/objects.c
src/sbuf.c
test/asynctest.c

index 8ad9b177510d085d09e507f0e448ce152e9ff5c3..8eff818ad82b8595b60f23cda6f42b34906143bf 100644 (file)
@@ -268,8 +268,10 @@ bool handle_auth_response(PgSocket *client, PktHdr *pkt) {
                        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 {
@@ -305,9 +307,11 @@ bool handle_auth_response(PgSocket *client, PktHdr *pkt) {
                        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;
index b51fbdd5965b039fa805f8e5292b7dcd2246af87..167a62ea08d4e24bc3f36bcc92487f618e13ab12 100644 (file)
@@ -334,7 +334,7 @@ static void pool_client_maint(PgPool *pool)
                        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;
 
index c321fa37b2f2926e05a9eec7b08bd06bdac5cc7e..7ce15662bf240b05980078f2fa04c9949c42fcc7 100644 (file)
@@ -949,7 +949,7 @@ static void dns_connect(struct PgSocket *server)
                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;
@@ -957,7 +957,7 @@ static void dns_connect(struct PgSocket *server)
                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;
@@ -1002,7 +1002,7 @@ bool evict_connection(PgDatabase *db)
                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));
@@ -1059,7 +1059,7 @@ void launch_new_connection(PgPool *pool)
 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;
index fe657f4a204a95a13e51f2d0b5a7856a1a1aaf39..0a37584b168d830d90e5d09b5294673f6a88ccbe 100644 (file)
@@ -260,7 +260,7 @@ void sbuf_prepare_send(SBuf *sbuf, SBuf *dst, unsigned amount)
 {
        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;
@@ -273,7 +273,7 @@ void sbuf_prepare_skip(SBuf *sbuf, unsigned amount)
 {
        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;
@@ -285,7 +285,7 @@ void sbuf_prepare_fetch(SBuf *sbuf, unsigned amount)
 {
        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;
index d6777cbfb1df1565f2b1faf5dcbe28481b461d14..a290d97bcd4fcf0a29785d890a96c6e13d1ff8a3 100644 (file)
@@ -35,9 +35,9 @@ typedef struct DbConn {
        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;
 
@@ -232,7 +232,7 @@ static bool another_result(DbConn *db)
 
        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) {