pike.git/
lib/
modules/
Sql.pmod/
pgsql_util.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2018-01-29
2018-01-29 11:37:04 by Stephen R. van den Berg <srb@cuci.nl>
00414537e9daf4fcb32b93899742113478fd13e3 (
18
lines) (+
11
/-
7
)
[
Show
|
Annotate
]
Branch:
8.0
pgsql: Readding primitive auto-reconnect logic.
1496:
final int(0..1) invalidatecache; private Thread.Queue qportals; final mixed delayederror;
-
private
function (:void) readyforquery_cb;
+
final
function (:void) readyforquery_cb;
final string host; final int(0..65535) port;
1698:
}; #endif int msgisfatal(mapping(string:string) msgresponse) {
-
if
(!terminating)
// Run the callback once per lost connection
-
runcallback
(
backendpid,"_lost","");
-
return (
has_prefix(msgresponse.C, "53")
+
int
isfatal
=
(has_prefix(msgresponse.C, "53")
|| has_prefix(msgresponse.C, "3D") || has_prefix(msgresponse.C, "57P")) && MAGICTERMINATE;
-
+
if (isfatal && !terminating) // Run the callback once per lost connection
+
runcallback(backendpid, "_lost", "");
+
return isfatal;
}; for (;;) { err = catch {
2394:
} }
-
private
void sendsync() {
+
final
void sendsync() {
readyforquerycount++; c->start()->sendcmd(SYNCSEND); } private void runcallback(int pid, string condition, string extrainfo) { array cb;
-
+
if (condition == "_lost")
+
destruct(c);
if ((cb = notifylist[condition] || notifylist[""]) && (pid != backendpid || sizeof(cb) > 1 && cb[1])) callout(cb[0], 0, pid, condition, extrainfo, @cb[2..]);