summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2006-07-13 07:26:46 +0000
committerSimon Josefsson <simon@josefsson.org>2006-07-13 07:26:46 +0000
commit29de4eee72001bc522e3c79b543c2b3e7d8fa507 (patch)
treec5bd7f984831a7f4038088220615259bf6262376
parent0b2af7dd18ca24d724d175cbd114ab6a628169f4 (diff)
downloadgnutls-29de4eee72001bc522e3c79b543c2b3e7d8fa507.tar.gz
Retry handshake on non-fatal errors.
-rw-r--r--libextra/gnutls_openssl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libextra/gnutls_openssl.c b/libextra/gnutls_openssl.c
index bf273b6b17..d73f9dcb94 100644
--- a/libextra/gnutls_openssl.c
+++ b/libextra/gnutls_openssl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Free Software Foundation
+ * Copyright (C) 2004, 2005, 2006 Free Software Foundation
* Copyright (c) 2002 Andrew McDonald <andrew@mcdonald.org.uk>
*
* This file is part of GNUTLS-EXTRA.
@@ -373,7 +373,9 @@ SSL_connect (SSL * ssl)
ssl->ctx->method->protocol_priority);
}
- err = gnutls_handshake (ssl->gnutls_state);
+ do
+ err = gnutls_handshake (ssl->gnutls_state);
+ while (ret < 0 && gnutls_error_is_fatal (ret) == 0);
ssl->last_error = err;
if (err < 0)
@@ -430,7 +432,9 @@ SSL_accept (SSL * ssl)
/* FIXME: dh params, do we want client cert? */
- err = gnutls_handshake (ssl->gnutls_state);
+ do
+ err = gnutls_handshake (ssl->gnutls_state);
+ while (ret < 0 && gnutls_error_is_fatal (ret) == 0);
ssl->last_error = err;
if (err < 0)