pike.git
/
lib
/
modules
/
Sql.pmod
/
pgsql.pike
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/pgsql.pike:611:
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? _connectfail(); else
-
catch(
destruct(waitforauthready)
)
;
// FIXME why can it be 0?
-
return;
-
}
-
}
// Do not flush at this point, PostgreSQL 9.4 disapproves
+
destruct(waitforauthready);
+
}
else
// Do not flush at this point, PostgreSQL 9.4 disapproves
procmessage(); }
-
+
}
private void procmessage() { int terminating=0; .pgsql_util.conxion ci=c; // cache value FIXME sensible? .pgsql_util.conxiin cr=ci->i; // cache value FIXME sensible? mixed err; #ifdef PG_DEBUG PD("Processloop\n"); void showportal(int msgtype) {
pike.git/lib/modules/Sql.pmod/pgsql.pike:1261:
m_delete(tp,"preparedname"); if(!_options.reconnect) ERROR("Lost connection to database %s:%d\n",_host,_port); } PD("Actually start to connect\n"); qportals=Thread.Queue(); _readyforcommit=Thread.Condition(); _readyforquerycount=1; _waittocommit=0; qportals->write(1);
-
if(!
(c=
getsocket())
)
-
ERROR
("Couldn't connect to database on %s:%
d\n
",_host,_port);
+
if(!getsocket())
{
+
string msg=sprintf
("Couldn't connect to database on %s:%
d
",_host,_port);
+
if(force) {
+
if(!sizeof(lastmessage) || lastmessage[sizeof(lastmessage)-1]!=msg)
+
lastmessage+=({msg});
+
return 0;
+
} else
+
ERROR(msg+"\n");
+
}
_runtimeparameter=([]); _unnamedportalmux=Thread.Mutex(); unnamedstatement=Thread.Mutex(); readyforquery_cb=recon?reconnect_cb:connect_cb; _portalsinflight=0; return 1; } //! For PostgreSQL this function performs the same function as @[resync()]. //!