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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:497:    final void connectloop(proxy 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");    start()->add_int32(8)->add_int32(PG_PROTOCOL(1234, 5679))    ->sendcmd(SENDOUT); -  switch (read_int8()) { +  string s = socket.read(1); +  switch (sizeof(s) && s[0]) {    case 'S': -  object fcon = SSL.File(socket, SSL.Context()); +  SSL.File fcon = SSL.File(socket, SSL.Context());    if (fcon->connect()) {    socket->set_backend(local_backend);    socket = fcon;    break;    }    default:    PD("%d>Close socket short\n", socket->query_fd());    socket->close();    pgsqlsess.nossl = 1;    continue;