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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:327:      class conxion {    inherit Stdio.Buffer:o;    final conxiin i;       private Thread.Queue qportals;    final Thread.Mutex shortmux;    private int closenext;       final sfile socket; -  private function(void|mixed:void) connectfail; +     private int towrite;    final multiset(function(void|mixed:void)) closecallbacks=(<>);       final Thread.Mutex nostash;    final Thread.MutexKey started;    final Thread.Queue stashqueue;    final Thread.Condition stashavail;    final Stdio.Buffer stash;    final int stashflushmode;    final int stashcount;
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:451:    }    if(towrite=sizeof(this)) {    PD("%d>Sendcmd %O\n",socket->query_fd(),((string)this)[..towrite-1]);    towrite-=output_to(socket,towrite);    }    } while(0);    lock=started=0;    return;    };    lock=0; -  catch(connectfail()); +  destruct(this);    }       final int close() {    if(!closenext && nostash) {    closenext=1;    Thread.MutexKey lock=i->fillreadmux->lock();    if(i->fillread) { // Delayed close() after flushing the output buffer    i->fillread.signal();    i->fillread=0;    }
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:488:    catch {    while(sizeof(closecallbacks))    foreach(closecallbacks;function(void|mixed:void) closecb;)    closecb();    destruct(nostash);    socket->set_nonblocking(); // Drop all callbacks    PD("%d>Close socket\n",socket->query_fd());    socket->close();    };    } -  catch(connectfail = 0); +     }       final void connectloop(object pgsqlsess, int nossl) {    mixed err=catch {    for(;;clear()) {    socket->connect(pgsqlsess._host,pgsqlsess._port);   #if constant(SSL.File)    if(!nossl && !pgsqlsess->nossl    && (pgsqlsess._options.use_ssl || pgsqlsess._options.force_ssl)) {    PD("SSLRequest\n");
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:527: Inside #if constant(SSL.File)
   }    }   #else    if(pgsqlsess._options.force_ssl)    error("Encryption library missing,"    " cannot establish connection to %s:%d\n",    pgsqlsess.host,pgsqlsess.port);   #endif    break;    } -  connectfail=pgsqlsess->_connectfail; +     if(!socket->is_open())    error(strerror(socket->errno())+".\n");    socket->set_backend(local_backend);    socket->set_buffer_mode(i,0);    socket->set_nonblocking(i->read_cb,write_cb,close); -  if (nossl != 2) { -  connectfail=pgsqlsess->_connectfail; +  if (nossl != 2)    Thread.Thread(pgsqlsess->_processloop,this); -  } +     return;    }; -  catch(connectfail(err)); +  destruct(this);    }       private string _sprintf(int type, void|mapping flags) {    string res=UNDEFINED;    switch(type) {    case 'O':    int fd=-1;    if(socket)    catch(fd=socket->query_fd());    res=predef::sprintf("conxion fd: %d input queue: %d/%d "