/* ready for read */
break;
default:
- printfPQExpBuffer(&conn->errorMessage,
- libpq_gettext(
- "server closed the connection unexpectedly\n"
- "\tThis probably means the server terminated abnormally\n"
- "\tbefore or while processing the request.\n"));
- goto definitelyFailed;
+ /* we override pqReadReady's message with something more useful */
+ goto definitelyEOF;
}
/*
/*
* OK, we are getting a zero read even though select() says ready. This
- * means the connection has been closed. Cope. Note that errorMessage
- * has been set already.
+ * means the connection has been closed. Cope.
*/
+definitelyEOF:
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext(
+ "server closed the connection unexpectedly\n"
+ "\tThis probably means the server terminated abnormally\n"
+ "\tbefore or while processing the request.\n"));
+
+ /* Come here if lower-level code already set a suitable errorMessage */
definitelyFailed:
conn->status = CONNECTION_BAD; /* No more connection to backend */
pqsecure_close(conn);