int pool_size; /* max server connections in one pool */
const char *dbname; /* server-side name, pointer to inside startup_msg */
+
+ /* startup commands to send to server after connect. malloc-ed */
+ const char *connect_query;
};
+
/*
* A client or server connection.
*
PgUser *auth_user; /* presented login, for client it may differ from pool->user */
- SocketState state; /* this also specifies socket location */
+ SocketState state:8; /* this also specifies socket location */
bool ready:1; /* server: accepts new query */
bool close_needed:1; /* server: this socket must be closed ASAP */
bool setting_vars:1; /* server: setting client vars */
+ bool exec_on_connect:1; /* server: executing connect_query */
bool wait_for_welcome:1;/* client: no server yet in pool, cannot send welcome msg */
usec_t request_time; /* last activity time */
usec_t query_start; /* query start moment */
- char salt[4]; /* login key salt */
uint8_t cancel_key[BACKENDKEY_LEN]; /* client: generated, server: remote */
PgAddr remote_addr; /* ip:port for remote endpoint */
PgAddr local_addr; /* ip:port for local endpoint */
#define tmp_sk_linkfd query_start
/* takeover_clean_socket() needs to clean those up */
+/* where the salt is temporarly stored */
+#define tmp_login_salt cancel_key
+
/* main.c */
extern int cf_verbose;
extern int cf_daemon;
extern char *cf_logfile;
extern char *cf_pidfile;
+extern char *cf_ignore_startup_params;
+
extern char *cf_admin_users;
extern char *cf_stats_users;
extern int cf_stats_period;
extern int cf_shutdown;
extern int cf_reboot;
+extern int cf_sbuf_loopcnt;
extern int cf_sbuf_len;
extern int cf_tcp_keepalive;
extern int cf_tcp_keepcnt;