pike.git
/
lib
/
modules
/
Sql.pmod
/
pgsql_util.pmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1490:
|| transtype == TRANSEND ? SYNCSEND : FLUSHSEND; } else inflight += fetchlimit, flushmode = FLUSHSEND; plugbuffer->sendcmd(flushmode, this); } inline private array setuptimeout() { return local_backend->call_out(gottimeout, timeout); }
+
inline void scuttletimeout(array cid) {
+
if (local_backend)
+
local_backend->remove_call_out(cid);
+
}
+
//! @returns //! One result row at a time. //! //! When using COPY FROM STDOUT, this method returns one row at a time //! as a single string containing the entire row. //! //! @seealso //! @[eof()], @[send_row()] /*semi*/final array(mixed) fetch_row() { int|array datarow; replenishrows(); if (arrayp(datarow = datarows->try_read())) return datarow; if (!eoffound) { if (!datarow) { PD("%O Block for datarow\n", _portalname); array cid = setuptimeout(); PT(datarow = datarows->read());
-
local_backend->remove_call_out
(cid);
+
scuttletimeout
(cid);
if (arrayp(datarow)) return datarow; } eoffound = 1; datarows->write(1); // Signal EOF for other threads } trydelayederror(); return 0; }
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1535:
//! @seealso //! @[eof()], @[fetch_row()] /*semi*/final array(array(mixed)) fetch_row_array() { if (eoffound) return 0; replenishrows(); array(array|int) datarow = datarows->try_read_array(); if (!sizeof(datarow)) { array cid = setuptimeout(); PT(datarow = datarows->read_array());
-
local_backend->remove_call_out
(cid);
+
scuttletimeout
(cid);
} replenishrows(); if (arrayp(datarow[-1])) return datarow; do datarow = datarow[..<1]; // Swallow EOF mark(s) while (sizeof(datarow) && !arrayp(datarow[-1])); trydelayederror(); eoffound = 1; datarows->write(1); // Signal EOF for other threads return datarow;
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1578:
_releasesession(); } private void run_result_cb( function(sql_result, array(mixed), mixed ...:void) callback, array(mixed) args) { int|array datarow; for (;;) { array cid = setuptimeout(); PT(datarow = datarows->read());
-
local_backend->remove_call_out
(cid);
+
scuttletimeout
(cid);
if (!arrayp(datarow)) break; callout(callback, 0, this, datarow, @args); } eoffound = 1; callout(callback, 0, this, 0, @args); } //! Sets up a callback for every row returned from the database. //! First argument passed is the resultobject itself, second argument
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:1607:
Thread.Thread(run_result_cb, callback, args); } private void run_result_array_cb( function(sql_result, array(array(mixed)), mixed ...:void) callback, array(mixed) args) { array(array|int) datarow; for (;;) { array cid = setuptimeout(); PT(datarow = datarows->read_array());
-
local_backend->remove_call_out
(cid);
+
scuttletimeout
(cid);
if (!datarow || !arrayp(datarow[-1])) break; callout(callback, 0, this, datarow, @args); } eoffound = 1; if (sizeof(datarow)>1) callout(callback, 0, this, datarow = datarow[..<1], @args); callout(callback, 0, this, 0, @args); }