pike.git / lib / modules / Sql.pmod / pgsql_util.pmod

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1489:    final mapping(string:mapping(string:mixed)) prepareds = ([]);    final int pportalcount;    final int totalhits;    final int msgsreceived; // Number of protocol messages received    final int bytesreceived; // Number of bytes received    final int warningsdropcount; // Number of uncollected warnings    private int warningscollected;    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;    private string database, user, pass;    private Crypto.Hash.SCRAM SASLcontext;    final Thread.Condition waitforauthready;    final Thread.Mutex shortmux;    final int readyforquerycount;       private string _sprintf(int type) {
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1691: Inside #if defined(PG_DEBUG)
   void showportal(int msgtype) {    if (objectp(portal))    PD("%d<%O %d %c switch portal\n",    ci->socket->query_fd(), portal._portalname, ++ci->queueinidx, msgtype);    else if (portal>0)    PD("%d<Sync %d %d %c portal\n",    ci->socket->query_fd(), ++ci->queueinidx, portal, msgtype);    };   #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 {   #ifdef PG_DEBUG    if (!portal && datarowdebug) {    PD("%s rows %d\n", datarowdebug, datarowdebugcount);    datarowdebug = 0; datarowdebugcount = 0;    }   #endif   #ifdef PG_DEBUGMORE
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:2387:    */    lastmessage = filter(lastmessage, lambda(string val) {    return has_prefix(val, "ERROR ") || has_prefix(val, "FATAL "); });    if (err || (err = catch(errstring = geterror(1))))    werror(describe_backtrace(err));    else if (errstring && sizeof(errstring))    werror("%s\n", errstring); // Add missing terminating newline    }    }    -  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..]);    }       private inline void closestatement(    bufcon|conxsess plugbuffer, string oldprep) {    closestatement(plugbuffer, oldprep);    }   };