pike.git/
lib/
modules/
Sql.pmod/
pgsql.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2016-02-17
2016-02-17 18:57:18 by Stephen R. van den Berg <srb@cuci.nl>
c198719d39153f9986178e2aa40e44f0b77191d8 (
28
lines) (+
14
/-
14
)
[
Show
|
Annotate
]
Branch:
8.0
pgsql: Protect against execution in destructed objects.
612:
plugbuffer->add_int8(0); PD("%O\n",(string)plugbuffer); if(catch(ci->start()->add_hstring(plugbuffer,4,4)->sendcmd(SENDOUT))) {
-
#ifdef
PG_DEBUG
-
if(
!_options
)
-
PD("_options
is
zero,
%O\n",this);
-
#endif
-
if(_options
&&
_options.reconnect)
//
FIXME
why
can
_options
be
0?
+
if(
this
) //
Only
when
not
destructed yet
+
if(
_options
.reconnect)
_connectfail(); else destruct(waitforauthready);
-
}
else
// Do not flush at this point, PostgreSQL 9.4 disapproves
+
return;
+
}
+
}
// Do not flush at this point, PostgreSQL 9.4 disapproves
procmessage(); }
-
}
+
private void procmessage() { int terminating=0;
1174:
break; } PD("Closing database processloop %O\n",err);
+
if(this)
_delayederror=err; for(;objectp(portal);portal=qportals->read()) if(objectp(portal)) {
1184:
} if(!ci->close() && !terminating && _options.reconnect) _connectfail();
-
else
+
else
if(this)
destruct(waitforauthready);
-
if(err && !stringp(err))
+
if(
this &&
err && !stringp(err))
throw(err); }