pgpool2.git / summary / log / commit / refs
commit 33fcebdd19f1a9b69cb7bbbf3a19088386357077
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Thu Jul 19 23:40:10 2012 +0000
Fix pool_ssl_read. When SSL_read returns unknown error, treat as if
EOF detected and returns 0 to caller (pool_read). This is same as
libpq's behavior. Also this will avoid unwanted failover ini
pool_read. pool_read triggers failover if underlying I/O functions,
read(2) or pool_ssl_read returns -1.
pool_ssl.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/pool_ssl.c b/pool_ssl.c
index b3e2d508a..194a01c85 100644
--- a/pool_ssl.c
+++ b/pool_ssl.c
@@ -167,8 +167,13 @@ int pool_ssl_read(POOL_CONNECTION *cp, void *buf, int size) {
n = -1;
break;
default:
- perror_ssl("SSL_read");
- n = -1;
+ pool_error("pool_ssl_read: unrecognized error code: %d", err);
+ /*
+ * We assume that the connection is broken. Returns 0
+ * rather than -1 in this case because -1 triggers
+ * unwanted failover in the caller (pool_read).
+ */
+ n = 0;
break;
}
[parent: 219515914fb3]