d4e1a3
From ab371f752536e88307b2c6867d6821ec1397525e Mon Sep 17 00:00:00 2001
d4e1a3
From: =?UTF-8?q?Patrik=20Novotn=C3=BD?= <panovotn@redhat.com>
d4e1a3
Date: Fri, 24 Jan 2020 01:04:48 +0100
d4e1a3
Subject: [PATCH] Handle EAGAIN error on socket write
d4e1a3
d4e1a3
    See BZ#1754816
d4e1a3
---
d4e1a3
 src/backend/libpq/be-secure.c | 2 +-
d4e1a3
 1 file changed, 1 insertion(+), 1 deletion(-)
d4e1a3
d4e1a3
diff --git a/src/backend/libpq/be-secure.c b/src/backend/libpq/be-secure.c
d4e1a3
index f6d9bc50c7..5af1f15239 100644
d4e1a3
--- a/src/backend/libpq/be-secure.c
d4e1a3
+++ b/src/backend/libpq/be-secure.c
d4e1a3
@@ -522,7 +522,7 @@ my_sock_write(BIO *h, const char *buf, int size)
d4e1a3
 	BIO_clear_retry_flags(h);
d4e1a3
 	if (res <= 0)
d4e1a3
 	{
d4e1a3
-		if (errno == EINTR)
d4e1a3
+		if (errno == EINTR || errno == EAGAIN)
d4e1a3
 		{
d4e1a3
 			BIO_set_retry_write(h);
d4e1a3
 		}
d4e1a3
-- 
d4e1a3
2.24.1
d4e1a3