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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql.pike:298:   //! The server has gone away, and the connection is dead.   //! @endint   //!   //! @seealso   //! @[is_open()]   /*semi*/final int ping() {    return is_open() && !catch(c->start()->sendcmd(FLUSHSEND))    ? !!reconnected : -1;   }    - private .pgsql_util.conxion getsocket(void|int nossl) { -  return .pgsql_util.conxion(this,qportals,(int)nossl); - } -  +    //! Cancels all currently running queries in this session.   //!   //! @seealso   //! @[reload()], @[resync()]   //!   //! @note   //! This function is PostgreSQL-specific, and thus it is not available   //! through the generic SQL-interface.   /*semi*/final void cancelquery() {    PD("CancelRequest\n"); -  .pgsql_util.conxion lcon=getsocket(2); +  .pgsql_util.conxion lcon = .pgsql_util.conxion(this, 0, 2);    lcon->add_int32(16)->add_int32(PG_PROTOCOL(1234,5678))    ->add_int32(backendpid)->add(cancelsecret)->sendcmd(FLUSHSEND);    destruct(lcon); // Destruct explicitly to avoid delayed close   #ifdef PG_DEBUGMORE    PD("Closetrace %O\n",backtrace());   #endif   }      //! Changes the connection charset. When set to @expr{"UTF8"@}, the query,   //! parameters and results can be Pike-native wide strings.
pike.git/lib/modules/Sql.pmod/pgsql.pike:1336:    m_delete(tp,"preparedname");    if(!_options.reconnect)    ERROR("Lost connection to database %s:%d\n",_host,_port);    }    PD("Actually start to connect\n");    qportals=Thread.Queue();    _readyforcommit=Thread.Condition();    _readyforquerycount=1;    _waittocommit=0;    qportals->write(1); -  if(!(c=getsocket())) +  if (!(c = .pgsql_util.conxion(this, qportals, 0)))    ERROR("Couldn't connect to database on %s:%d\n",_host,_port);    _runtimeparameter=([]);    _unnamedportalmux=Thread.Mutex();    unnamedstatement=Thread.Mutex();    readyforquery_cb=recon?reconnect_cb:connect_cb;    _portalsinflight=0;    _statementsinflight = 0;    _wasparallelisable = 0;    return 1;   }