Branch: Tag:

2010-03-23

2010-03-23 18:15:42 by Stephen R. van den Berg <srb@cuci.nl>

Properly fix authentication errors.

Rev: lib/modules/Sql.pmod/pgsql.pike:1.79

1034:   { close();   }    - private void reconnect(void|int force) + private int reconnect(void|int force)   { Thread.MutexKey connectmtxkey;    if(_c)    { reconnected++;
1075:    plugbuf[0]=_c.plugint32(len);    _c.write(plugbuf);    PD("%O\n",plugbuf); -  _decodemsg(readyforquery); +  { mixed err=catch(_decodemsg(readyforquery)); +  if(err) +  if(force) +  return 0; +  else +  throw(err); +  }    PD("%O\n",_runtimeparameter);    if(force)    { lastmessage+=({sprintf("Reconnected to database %s",host_info())});    runcallback(backendpid,"_reconnect","");    } -  +  return 1;   }      //! @decl void reload()