Branch: Tag:

2014-11-15

2014-11-15 00:58:22 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Properly terminate the connection if the database does not exist.

180:       private inline void queueup(sql_result portal) {    qportals->write(portal); portal->_synctransact=synctransact; -  PD(">%O %d %d Queue portal %d bytes\n",portal._portalname,++queueoutidx, -  synctransact,sizeof(this)); +  PD("%d>%O %d %d Queue portal %d bytes\n",socket->query_fd(), +  portal._portalname,++queueoutidx,synctransact,sizeof(this));    }       final conxion|bufcon start(void|int waitforreal) {
229:       private int write_cb() {    towrite-=output_to(socket,towrite); -  if(!fillread && !sizeof(this)) +  if(!fillread && !sizeof(this)) { +  PD("%d>Close socket delayed\n",socket->query_fd());    socket->close(); -  +  }    return 0;    }   
253:    default:    break nosync;    case syncsend: -  PD(">Sync %d %d Queue\n",synctransact,++queueoutidx); +  PD("%d>Sync %d %d Queue\n", +  socket->query_fd(),synctransact,++queueoutidx);    add(PGSYNC);    mode=sendout;    break;    case flushlogsend: -  PD(">%O %d Queue simplequery %d bytes\n",portal._portalname, -  ++queueoutidx,sizeof(this)); +  PD("%d>%O %d Queue simplequery %d bytes\n", +  socket->query_fd(),portal._portalname,++queueoutidx,sizeof(this));    mode=flushsend;    }    qportals->write(synctransact++);
287:    case sendout:;    }    if(towrite=sizeof(this)) { -  PD(">Sendcmd %O\n",((string)this)[..towrite-1]); +  PD("%d>Sendcmd %O\n",socket->query_fd(),((string)this)[..towrite-1]);    towrite-=output_to(socket,towrite);    }    } while(0);
304:       final int close() {    destruct(nostash); +  PD("%d>Close socket\n",socket->query_fd());    return socket->close();    }   
329: Inside #if constant(SSL.File)
   socket=fcon;    break;    } -  default:socket->close(); +  default:PD("%d>Close socket\n",socket->query_fd()); +  socket->close();    pgsqlsess.nossl=1;    continue;    case 'N':