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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:499:    final void connectloop(object 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=fcon;    break;    }    default:    PD("%d>Close socket short\n", socket->query_fd());    socket->close();    pgsqlsess.nossl=1;    continue;    case 'N':