调整light_comm参数级别
This commit is contained in:
@ -448,7 +448,7 @@ readloop:
|
||||
ssize_t secure_read(Port *port, void *ptr, size_t len)
|
||||
{
|
||||
ssize_t n = 0;
|
||||
if (u_sess->attr.attr_common.light_comm == TRUE) {
|
||||
if (g_instance.attr.attr_common.light_comm == TRUE) {
|
||||
n = light_secure_read(port, ptr, len);
|
||||
} else {
|
||||
n = old_secure_read(port, ptr, len);
|
||||
@ -696,7 +696,7 @@ retry:
|
||||
ssize_t secure_write(Port *port, void *ptr, size_t len)
|
||||
{
|
||||
ssize_t n = 0;
|
||||
if (u_sess->attr.attr_common.light_comm == TRUE) {
|
||||
if (g_instance.attr.attr_common.light_comm == TRUE) {
|
||||
n = light_secure_write(port, ptr, len);
|
||||
} else {
|
||||
n = old_secure_write(port, ptr, len);
|
||||
|
||||
@ -464,7 +464,7 @@ void pq_init(void)
|
||||
* should always use COMMERROR on failure during communication
|
||||
*/
|
||||
#ifndef WIN32
|
||||
if (u_sess->attr.attr_common.light_comm == TRUE &&
|
||||
if (g_instance.attr.attr_common.light_comm == TRUE &&
|
||||
u_sess->proc_cxt.MyProcPort->sock != PGINVALID_SOCKET && !pg_set_noblock(u_sess->proc_cxt.MyProcPort->sock)){
|
||||
ereport(COMMERROR, (errmsg("could not set socket to nonblocking mode: %m")));
|
||||
}
|
||||
@ -1172,7 +1172,7 @@ void TouchSocketFile(void)
|
||||
*/
|
||||
void pq_set_nonblocking(bool nonblocking)
|
||||
{
|
||||
if (u_sess->attr.attr_common.light_comm == FALSE) {
|
||||
if (g_instance.attr.attr_common.light_comm == FALSE) {
|
||||
if (u_sess->proc_cxt.MyProcPort->noblock == nonblocking) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1979,13 +1979,13 @@ static void InitConfigureNamesBool()
|
||||
NULL
|
||||
},
|
||||
{{"light_comm",
|
||||
PGC_BACKEND,
|
||||
PGC_POSTMASTER,
|
||||
NODE_ALL,
|
||||
CLIENT_CONN,
|
||||
gettext_noop("Enable to use light connection"),
|
||||
NULL,
|
||||
},
|
||||
&u_sess->attr.attr_common.light_comm,
|
||||
&g_instance.attr.attr_common.light_comm,
|
||||
false,
|
||||
NULL,
|
||||
NULL,
|
||||
|
||||
Reference in New Issue
Block a user