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