summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2005-12-01 11:55:52 +0000
committerSimon Josefsson <simon@josefsson.org>2005-12-01 11:55:52 +0000
commitb36346bda4b00b9d510a4283affa56b281f1417b (patch)
treecc146c757c08ed7f6a2dc7883629b22483b8ae3e
parenteccbf09d0a53de28987e1b401d159d66b18f14d2 (diff)
downloadgnutls-b36346bda4b00b9d510a4283affa56b281f1417b.tar.gz
Don't infloop.
-rw-r--r--src/cli.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/cli.c b/src/cli.c
index ac5fc31514..3d8cf1d88c 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -632,24 +632,17 @@ after_handshake:
for (;;)
{
- if (starttls_alarmed)
+ if (starttls_alarmed && !hd.secure)
{
- if (hd.secure == 0)
- {
- fprintf (stderr, "*** Starting TLS handshake\n");
- ret = do_handshake (&hd);
- if (ret < 0)
- {
- fprintf (stderr, "*** Handshake has failed\n");
- socket_bye (&hd);
- user_term = 1;
- }
- }
- else
+ fprintf (stderr, "*** Starting TLS handshake\n");
+ ret = do_handshake (&hd);
+ if (ret < 0)
{
+ fprintf (stderr, "*** Handshake has failed\n");
+ socket_bye (&hd);
user_term = 1;
+ break;
}
- continue;
}
FD_ZERO (&rset);