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

pgsql: Suppress errors if the server gets lost.

parent 08505c02
No related branches found
No related tags found
No related merge requests found
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
//! This is an interface to the PostgreSQL database //! This is an interface to the PostgreSQL database
//! server. This module is independent of any external libraries. //! server. This module is independent of any external libraries.
//! Note that you @b{do not@} need to have a //! Note that you @b{do not@} need to have a
//! PostgreSQL server running on your host to use this module: you can //! PostgreSQL server running on @b{your@} host to use this module: you can
//! connect to the database over a TCP/IP socket. //! connect to the database over a TCP/IP socket on a different host.
//! //!
//! This module replaces the functionality of the older @[Sql.postgres] //! This module replaces the functionality of the older @[Sql.postgres]
//! and @[Postgres.postgres] modules. //! and @[Postgres.postgres] modules.
...@@ -1193,9 +1193,11 @@ private void procmessage() { ...@@ -1193,9 +1193,11 @@ private void procmessage() {
} }
}; // We only get here if there is an error }; // We only get here if there is an error
if(err==MAGICTERMINATE) { // Announce connection termination to server if(err==MAGICTERMINATE) { // Announce connection termination to server
catch {
object cs = ci->start(); object cs = ci->start();
CHAIN(cs)->add("X\0\0\0\4"); CHAIN(cs)->add("X\0\0\0\4");
cs->sendcmd(SENDOUT); cs->sendcmd(SENDOUT);
};
terminating=1; terminating=1;
err=0; err=0;
} else if(stringp(err)) { } else if(stringp(err)) {
......
...@@ -200,7 +200,7 @@ class bufcon { ...@@ -200,7 +200,7 @@ class bufcon {
if (mode == SYNCSEND) { if (mode == SYNCSEND) {
add(PGSYNC); add(PGSYNC);
realbuffer->stashqueue->write(1); realbuffer->stashqueue->write(1);
mode = SENDOUT; mode = SENDOUT; // Demote it to prevent an extra SYNC upon stashflush
} }
} }
realbuffer->stash->add(this); realbuffer->stash->add(this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment