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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql.pike:1031:      void destroy()   { close();   }      private int reconnect(void|int force)   { Thread.MutexKey connectmtxkey;    if(_c)    { reconnected++;    prepstmtused=0; - #ifdef DEBUG -  ERROR("While debugging, reconnects are forbidden\n"); -  exit(1); - #endif +     if(!force)    _c.sendterminate();    _c.close(); _c=0;    foreach(prepareds;;mapping tp)    m_delete(tp,"preparedname");    if(!(connectmtxkey = _stealmutex.trylock(2)))    return 0; // Recursive reconnect, bailing out    }    if(!(_c=getsocket()))    { string msg=sprintf("Couldn't connect to database on %s:%d",host,port);
pike.git/lib/modules/Sql.pmod/pgsql.pike:1515:    "P",portalname,"\0"}));    }    _c.sendcmd(({"S",_c.plugint32(4)}),2);    }    else    _c.portal->_inflight+=fetchlimit;   }      final private void sendclose(void|int hold)   { string portalname; -  if(_c.portal && (portalname=_c.portal->_portalname)) +  if(!_c) +  portalsinflight=unnamedportalinuse=0; +  else if(_c.portal && (portalname=_c.portal->_portalname))    { _c.portal->_portalname = UNDEFINED;    _c.setportal();    portalsinflight--;   #ifdef DEBUGMORE    PD("Closetrace %O\n",backtrace());   #endif    if(!sizeof(portalname))    unnamedportalinuse--;    if(sizeof(portalname))    { if(!earlyclose)