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:146:
case MACADDROID: case BPCHAROID: case VARCHAROID: case CTIDOID: case UUIDOID: return 1; //binary } return 0; // text }
-
private int mergemode(conxion realbuffer,int mode) {
-
if(mode>realbuffer->stashflushmode)
-
realbuffer->stashflushmode=mode;
-
return realbuffer->stashflushmode;
-
}
-
+
private inline mixed callout(function(mixed ...:void) f, float|int delay,mixed ... args) { return local_backend->call_out(f,delay,@args); } // Some pgsql utility functions class bufcon { inherit Stdio.Buffer;
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:198:
Thread.MutexKey lock=realbuffer->shortmux->lock(); if(portal) { realbuffer->stashqueue->write(portal); if (mode == SYNCSEND) { add(PGSYNC); realbuffer->stashqueue->write(1); mode = SENDOUT; // Demote it to prevent an extra SYNC upon stashflush } } realbuffer->stash->add(this);
-
mergemode
(realbuffer, mode);
+
PD
(
"%d>Got stash mode %d > %d\n",
+
realbuffer
->socket->query_fd()
, mode
, realbuffer->stashflushmode
);
+
if (mode > realbuffer->stashflushmode)
+
realbuffer->stashflushmode = mode;
if(!--realbuffer->stashcount) realbuffer->stashavail.signal(); lock=0; this->clear(); if(lock=realbuffer->nostash->trylock(1)) { #ifdef PG_DEBUGRACE conxsess sess = conxsess(realbuffer); realbuffer->started = lock; lock = 0; sess->sendcmd(SENDOUT);
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:343:
} private int getstash(int mode) { if (sizeof(stash)) { add(stash); stash->clear(); foreach (stashqueue->try_read_array();; int|sql_result portal) if (intp(portal)) qportals->write(synctransact++); else queueup(portal);
-
mode
=
mergemode
(
this
, mode);
+
PD("%d>Got stash
mode
%d
> %d\n",
+
socket->query_fd
(
)
,
stashflushmode,
mode);
+
if (stashflushmode > mode)
+
mode = stashflushmode;
stashflushmode = KEEP; } return mode; } final void sendcmd(void|int mode, void|sql_result portal) { Thread.MutexKey lock; if (portal) queueup(portal); unfinalised:
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:385:
do { switch(mode) { default: PD("%d>Skip flush %d Queue %O\n", socket->query_fd(), mode, (string)this); break outer; case FLUSHLOGSEND: case FLUSHSEND: PD("Flush\n"); add(PGFLUSH);
-
case SYNCSEND:
+
case SENDOUT:; } 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; };