When transaction pooling is used, the `server_reset_query` should be empty,
as clients should not use any session features. If client does use session
-features, then they will be broken as transaction pooling will not guaratee
+features, then they will be broken as transaction pooling will not guarantee
that next query will be run on same connection.
Default: DISCARD ALL
* units for config parameters.
* some preliminary notification that fd limit is full
- * Move all "look-at-full-packet" situtations to SBUF_EV_PKT_CALLBACK
+ * Move all "look-at-full-packet" situations to SBUF_EV_PKT_CALLBACK
* `pool_mode = plproxy` - use postgres in full-duplex mode for autocommit
queries, multiplexing several queries into one connection. Should result
- in more effiicent CPU usage of server.
+ in more efficient CPU usage of server.
- * SMP: spread sockets over per-cpu threads. needs confirmation that
- single-threadedness can be problem. it can also be that only
- accept() + login handling of short connection is problem.
+ * SMP: spread sockets over per-cpu threads. Needs confirmation that
+ single-threadedness can be problem. It can also be that only
+ accept() + login handling of short connection is problem
that could be solved by just having threads for login handling,
- which would be lot simpler. or just deciding that its not
+ which would be lot simpler or just deciding that it is not
worth fixing.
#define FULLVER PACKAGE_NAME " version " PACKAGE_VERSION
#endif
-/* each state corresponts to a list */
+/* each state corresponds to a list */
enum SocketState {
CL_FREE, /* free_client_list */
CL_JUSTFREE, /* justfree_client_list */
struct List head; /* entry in global pool_list */
struct List map_head; /* entry in user->pool_list */
- PgDatabase *db; /* corresponging database */
+ PgDatabase *db; /* corresponding database */
PgUser *user; /* user logged in as */
struct StatList active_client_list; /* waiting events logged in clients */
* first(db->forced_user->pool_list), where pool_list has only one entry.
*
* Otherwise, ->pool_list contains multiple pools, for all PgDatabases
- * whis user has logged in.
+ * which user has logged in.
*/
struct PgUser {
struct List head; /* used to attach user to list */
#define tmp_sk_linkfd query_start
/* takeover_clean_socket() needs to clean those up */
-/* where the salt is temporarly stored */
+/* where the salt is temporarily stored */
#define tmp_login_salt cancel_key
/* main.c */
/*
* note: new pooler expects unix socket file gone when it gets
- * event from fd. currently atexit() cleanup should be called
+ * event from fd. Currently atexit() cleanup should be called
* before closing open sockets.
*/
log_info("SHUTDOWN command issued");
const char *q;
bool res;
- /* dont tolerate partial packets */
+ /* don't tolerate partial packets */
if (incomplete_pkt(pkt)) {
disconnect_client(admin, true, "incomplete pkt");
return false;
if (!dbname || !dbname[0])
dbname = username;
- /* check if limit allows, dont limit admin db
+ /* check if limit allows, don't limit admin db
nb: new incoming conn will be attached to PgSocket, thus
get_active_client_count() counts it */
if (get_active_client_count() > cf_max_client_conn) {
if (client->pool->db->admin)
return admin_handle_client(client, pkt);
- /* aquire server */
+ /* acquire server */
if (!find_server(client))
return false;
active += suspend_socket_list(&pool->active_client_list, force_suspend);
- /* this list is unsuspendable, but still need force_suspend and counting */
+ /* this list is not suspendable, but still need force_suspend and counting */
active += suspend_socket_list(&pool->waiting_client_list, force_suspend);
if (active)
per_loop_activate(pool);
safe_evtimer_add(&full_maint_ev, &full_maint_period);
}
-/* first-time initializtion */
+/* first-time initialization */
void janitor_setup(void)
{
/* launch maintenance */
return p;
}
-/* parse paramenter name before '=' */
+/* parse parameter name before '=' */
static char *cstr_get_key(char *p, char **dst_p)
{
char *end;
}
/*
- * Get key=val pair from connstring. returns position it stopped
+ * Get key=val pair from connstring. Returns position it stopped
* or NULL on error. EOF is signaled by *key = 0.
*/
static char * cstr_get_pair(char *p,
*/
/*
- * Launcer for all the rest.
+ * Launcher for all the rest.
*/
#include "bouncer.h"
die("Cannot load config file");
} else {
log_warning("Config file loading failed");
- /* if ini file missing, dont kill anybody */
+ /* if ini file missing, don't kill anybody */
set_dbs_dead(false);
}
if (!cf_pidfile[0])
fatal("daemon needs pidfile configured");
- /* dont log to stdout anymore */
+ /* don't log to stdout anymore */
cf_quiet = 1;
/* send stdin, stdout, stderr to /dev/null */
/*
* As the activate_client() does full read loop,
- * then it may happen that linked client close
- * couses server close. Report it.
+ * then it may happen that linked client closing
+ * causes server closing. Report it.
*/
if (server->state == SV_FREE || server->state == SV_JUSTFREE)
res = false;
*
* Related to tcp_synack_retries sysctl, default 5 (corresponds 180 secs).
*
- * SO_ACCEPTFILTER needs to be set after listern(), maybe TCP_DEFER_ACCEPT too.
+ * SO_ACCEPTFILTER needs to be set after listen(), maybe TCP_DEFER_ACCEPT too.
*/
static void tune_accept(int sock, bool on)
{
log_noise("get_header: unknown special pkt");
return false;
}
- /* dont tolerate partial pkt */
+ /* don't tolerate partial pkt */
if (mbuf_avail_for_read(&hdr) < OLD_HEADER_LEN - 2) {
log_noise("get_header: less than 8 bytes for special pkt");
return false;
sbuf_call_proto(sbuf, SBUF_EV_RECV_FAILED);
return false;
} else if (got < 0 && errno != EAGAIN) {
- /* some error occured */
+ /* some error occurred */
sbuf_call_proto(sbuf, SBUF_EV_RECV_FAILED);
return false;
}
/*
* 'E' and 'N' packets currently set ->ready to 0. Correct would
- * be to leave ->ready as-is, because overal TX state stays same.
+ * be to leave ->ready as-is, because overall TX state stays same.
* It matters for connections in IDLE or USED state which get dirty
* suddenly but should not as they are still usable.
*
} else {
gr = getgrnam(group_name);
if (!gr)
- fatal("cound not find group '%s': %s",
+ fatal("could not find group '%s': %s",
group_name, strerror(errno));
gid = gr->gr_gid;
}
/* move listpos further */
listpos = p + len;
- /* survive len=0 and avoid unneccesary compare */
+ /* survive len=0 and avoid unnecessary compare */
if (*listpos)
listpos++;
pktbuf_start_packet(pkt, 'Q');
- /* grab quory position inside pkt */
+ /* grab query position inside pkt */
sql_ofs = pktbuf_written(pkt);
for (lk = lookup; lk->name; lk++) {
}
/*
- * Connection has a resultset avalable, fetch it.
+ * Connection has a resultset available, fetch it.
*
* Returns true if there may be more results coming,
* false if all done.