summaryrefslogtreecommitdiff
path: root/src/backend/libpq/be-secure.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/libpq/be-secure.c')
-rw-r--r--src/backend/libpq/be-secure.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/backend/libpq/be-secure.c b/src/backend/libpq/be-secure.c
index cdd07d577b0..9a9a5c23cce 100644
--- a/src/backend/libpq/be-secure.c
+++ b/src/backend/libpq/be-secure.c
@@ -123,6 +123,9 @@ secure_read(Port *port, void *ptr, size_t len)
ssize_t n;
int waitfor;
+ /* Deal with any already-pending interrupt condition. */
+ ProcessClientReadInterrupt(false);
+
retry:
#ifdef USE_SSL
waitfor = 0;
@@ -186,9 +189,8 @@ retry:
}
/*
- * Process interrupts that happened while (or before) receiving. Note that
- * we signal that we're not blocking, which will prevent some types of
- * interrupts from being processed.
+ * Process interrupts that happened during a successful (or non-blocking,
+ * or hard-failed) read.
*/
ProcessClientReadInterrupt(false);
@@ -225,6 +227,9 @@ secure_write(Port *port, void *ptr, size_t len)
ssize_t n;
int waitfor;
+ /* Deal with any already-pending interrupt condition. */
+ ProcessClientWriteInterrupt(false);
+
retry:
waitfor = 0;
#ifdef USE_SSL
@@ -263,17 +268,16 @@ retry:
/*
* We'll retry the write. Most likely it will return immediately
- * because there's still no data available, and we'll wait for the
- * socket to become ready again.
+ * because there's still no buffer space available, and we'll wait
+ * for the socket to become ready again.
*/
}
goto retry;
}
/*
- * Process interrupts that happened while (or before) sending. Note that
- * we signal that we're not blocking, which will prevent some types of
- * interrupts from being processed.
+ * Process interrupts that happened during a successful (or non-blocking,
+ * or hard-failed) write.
*/
ProcessClientWriteInterrupt(false);