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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1562:    if (statusccomplete && !statuscmdcomplete) {    Thread.MutexKey lock = _ddescribemux->lock();    statuscmdcomplete = statusccomplete;    _ddescribe->broadcast();    }    inflight = 0;    conxsess plugbuffer;    array(Thread.MutexKey) reflock = ({ 0 });    for (;;) {    reflock[0] = closemux->lock(aborted); -  if (!catch(plugbuffer = c->start(reflock))) +  if (!catch(plugbuffer = c->start(reflock))) { +  if (!this) // If dead +  return;    if (plugbuffer)    plugbuffer->sendcmd(_closeportal(plugbuffer, reflock));    else {    PD("Releasesession retry closemux %O\n", _portalname);    continue;    } -  +  }    break;    }    reflock[0] = 0;    if (_state < CLOSED) {    stmtifkey = 0;    _state = CLOSED;    }    datarows->write(1); // Signal EOF    releaseconditions(aborted);    }
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1955:    if (user)    plugbuffer->add("user\0", user, 0);    if (database)    plugbuffer->add("database\0", database, 0);    foreach (options - censoroptions; string name; mixed value)    plugbuffer->add(name, 0, (string)value, 0);    plugbuffer->add_int8(0);    PD("%O\n", (string)plugbuffer);    void|bufcon|conxsess cs;    if (catch(cs = ci->start())) { +  if (this) { // Only if still alive    destruct(waitforauthready);    unnamedstatement = 0;    termlock = 1; -  +  }    return;    } else {    CHAIN(cs)->add_hstring(plugbuffer, 4, 4);    cs->sendcmd(SENDOUT);    }    } // Do not flush at this point, PostgreSQL 9.4 disapproves    procmessage();    }       private void stasherror(int|object portal, mixed err) {