Skip to content
Snippets Groups Projects
Commit fd6066bc authored by Stephen R. van den Berg's avatar Stephen R. van den Berg
Browse files

Throw authentication errors early.

Rev: lib/modules/Sql.pmod/pgsql.pike:1.78
parent 2d42a683
No related branches found
No related tags found
No related merge requests found
...@@ -1034,7 +1034,7 @@ void destroy() ...@@ -1034,7 +1034,7 @@ void destroy()
{ close(); { close();
} }
private int reconnect(void|int force) private void reconnect(void|int force)
{ Thread.MutexKey connectmtxkey; { Thread.MutexKey connectmtxkey;
if(_c) if(_c)
{ reconnected++; { reconnected++;
...@@ -1075,19 +1075,12 @@ private int reconnect(void|int force) ...@@ -1075,19 +1075,12 @@ private int reconnect(void|int force)
plugbuf[0]=_c.plugint32(len); plugbuf[0]=_c.plugint32(len);
_c.write(plugbuf); _c.write(plugbuf);
PD("%O\n",plugbuf); PD("%O\n",plugbuf);
{ mixed err=catch(_decodemsg(readyforquery)); _decodemsg(readyforquery);
if(err)
if(force)
throw(err);
else
return 0;
}
PD("%O\n",_runtimeparameter); PD("%O\n",_runtimeparameter);
if(force) if(force)
{ lastmessage+=({sprintf("Reconnected to database %s",host_info())}); { lastmessage+=({sprintf("Reconnected to database %s",host_info())});
runcallback(backendpid,"_reconnect",""); runcallback(backendpid,"_reconnect","");
} }
return 1;
} }
//! @decl void reload() //! @decl void reload()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment