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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:542:   #else    return this;   #endif    }    if (arrayp(waitforreal))    waitforreal[0] = 0;    return !waitforreal && bufcon(this)->start();    }       private void done_cb() { -  if (this) { // Guard against async destructs +     if (!i->fillread)    close();    } -  } +        private int getstash(int mode) {    Thread.MutexKey lock = shortmux->lock();    add(stash); stash->clear();    foreach (stashqueue->try_read_array(); ; int|Result portal)    if (intp(portal))    qportals->write(synctransact++);    else    queueup(portal);    PD("%d>Got stash mode %d > %d\n",
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:642:    PD("Sendcmd failed %s\n", describe_backtrace(err));    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 +  shuffle->set_done_callback(done_cb);    i->fillread.signal();    i->fillread = 0;    }    }    PD("%d>Delayed close, flush write\n", socket->query_fd());    i->read_cb(socket->query_id(), 0);    return 0;    } else    return -1;    }
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:679:    result.delayederror = LOSTERROR;    result._ddescribe->broadcast();    runningportals[result] = 0;    } else    destruct(result);    };    destruct(nostash);    if (socket->set_non_blocking)    socket->set_non_blocking(); // Drop all callbacks    PD("%d>Close socket\n", socket->query_fd()); +  shuffle->stop();    socket->close(); // This will be an asynchronous close    }    destruct(this);    }    }       protected void _destruct() {    PD("%d>Close conxion %d\n", socket ? socket->query_fd() : -1, !!nostash);    catch(purge());    }
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:737:    " cannot establish connection to %s:%d\n",    pgsqlsess.host, pgsqlsess.port);   #endif    break;    }    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, 0, close); -  (shuffle = shuffler->shuffle(socket))->set_done_callback(done_cb); +  shuffle = shuffler->shuffle(socket);    if (nossl != 2)    Thread.Thread(pgsqlsess->processloop, this);    return;    };    PD("Connect error %s\n", describe_backtrace(err));    catch(destruct(pgsqlsess->waitforauthready));    destruct(this);    }       protected string _sprintf(int type) {