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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:333:    } while(0);    lock=started=0;    return;    };    lock=0;    catch(connectfail());    }       final int close() {    int ret; -  { Thread.MutexKey lock=i->fillreadmux->lock(); +  if(!termlock && nostash) +  { termlock=termthread->lock(); +  Thread.MutexKey lock=i->fillreadmux->lock();    if(i->fillread) { // Delayed close() after flushing the output buffer    i->fillread.signal();    i->fillread=0; -  +  }    lock=0; -  PD("%d>Close socket read, flush write\n",socket->query_fd()); -  ret=socket->close("r"); +  PD("%d>Delayed close, flush write\n",socket->query_fd());    i->read_cb(socket->query_id(),0);    return ret;    } -  lock=0; -  } +     destruct(nostash);    PD("%d>Close socket\n",socket->query_fd());    ret=socket->close();    foreach(closecallbacks;function(void|mixed:void) closecb;)    closecb();    closecallbacks=(<>);    termlock=0;    return ret;    }       protected void destroy() { -  termlock=termthread->lock(); +     catch(close()); // Exceptions don't work inside destructors    connectfail=0;    termthread->lock(1);    }       final void connectloop(object pgsqlsess, int nossl) {    mixed err=catch {    for(;;clear()) {    socket->connect(pgsqlsess._host,pgsqlsess._port);   #if constant(SSL.File)