* As above, after appending conn->write_err_msg to whatever other error we * have. This is used when we've detected a write failure and have exhausted * our chances of reporting something else instead. */
| 809 | * our chances of reporting something else instead. |
| 810 | */ |
| 811 | static void |
| 812 | pqSaveWriteError(PGconn *conn) |
| 813 | { |
| 814 | /* |
| 815 | * If write_err_msg is null because of previous strdup failure, do what we |
| 816 | * can. (It's likely our machinations here will get OOM failures as well, |
| 817 | * but might as well try.) |
| 818 | */ |
| 819 | if (conn->write_err_msg) |
| 820 | { |
| 821 | appendPQExpBufferStr(&conn->errorMessage, conn->write_err_msg); |
| 822 | /* Avoid possibly appending the same message twice */ |
| 823 | conn->write_err_msg[0] = '\0'; |
| 824 | } |
| 825 | else |
| 826 | appendPQExpBufferStr(&conn->errorMessage, |
| 827 | libpq_gettext("write to server failed\n")); |
| 828 | |
| 829 | pqSaveErrorResult(conn); |
| 830 | } |
| 831 | |
| 832 | /* |
| 833 | * This subroutine prepares an async result object for return to the caller. |
no test coverage detected