[glib-networking] gnutls: Allow closing a connection cleanly if handshake fails
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking] gnutls: Allow closing a connection cleanly if handshake fails
- Date: Thu, 29 Nov 2012 22:04:57 +0000 (UTC)
commit 0084d6b8bd8a0f82ba7fb2fc8550cbb2159df5e9
Author: Stef Walter <stefw gnome org>
Date: Thu Nov 29 11:01:45 2012 +0100
gnutls: Allow closing a connection cleanly if handshake fails
Only set the internal ever_handshaked flag if the handshake was
successful. Otherwise using g_io_stream_close() after a handshake
failure results in an internal gnutls error.
https://bugzilla.gnome.org/show_bug.cgi?id=689260
tls/gnutls/gtlsconnection-gnutls.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index 2603532..e67329d 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -1082,12 +1082,15 @@ handshake_thread (GTask *task,
END_GNUTLS_IO (gnutls, G_IO_IN | G_IO_OUT, ret,
_("Error performing TLS handshake: %s"), &error);
- gnutls->priv->ever_handshaked = TRUE;
-
if (error)
- g_task_return_error (task, error);
+ {
+ g_task_return_error (task, error);
+ }
else
- g_task_return_boolean (task, TRUE);
+ {
+ gnutls->priv->ever_handshaked = TRUE;
+ g_task_return_boolean (task, TRUE);
+ }
}
static GTlsCertificate *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]