summaryrefslogtreecommitdiff
path: root/lib/state.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-04-28 10:31:50 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-04-28 13:42:40 +0200
commit8d095429ea6f01a6db84df8d896a0f7bb5b0bba1 (patch)
treeae6de0e0f165250186aad2eb9e08dcb87b740a9b /lib/state.c
parentcfe068979d11ef99362cb3b2354556c275911a1b (diff)
downloadgnutls-8d095429ea6f01a6db84df8d896a0f7bb5b0bba1.tar.gz
instead of assigning a variable per flag use the init flags directly
That is store the flags provided in gnutls_init() in the session structure and use these flags directly when required.
Diffstat (limited to 'lib/state.c')
-rw-r--r--lib/state.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/lib/state.c b/lib/state.c
index 03dc2d3620..6527695067 100644
--- a/lib/state.c
+++ b/lib/state.c
@@ -424,11 +424,6 @@ int gnutls_init(gnutls_session_t * session, unsigned int flags)
(*session)->internals.transport = GNUTLS_STREAM;
}
- if (flags & GNUTLS_NONBLOCK)
- (*session)->internals.blocking = 0;
- else
- (*session)->internals.blocking = 1;
-
/* Enable useful extensions */
if ((flags & GNUTLS_CLIENT) && !(flags & GNUTLS_NO_EXTENSIONS)) {
#ifdef ENABLE_SESSION_TICKETS
@@ -440,20 +435,7 @@ int gnutls_init(gnutls_session_t * session, unsigned int flags)
#endif
}
- if (!(flags & GNUTLS_NO_EXTENSIONS))
- (*session)->internals.try_ext_master_secret = 1;
-
- if (flags & GNUTLS_FORCE_CLIENT_CERT)
- (*session)->internals.force_client_cert = 1;
-
- if (flags & GNUTLS_NO_REPLAY_PROTECTION)
- (*session)->internals.no_replay_protection = 1;
-
- if (flags & GNUTLS_ALLOW_CERT_CHANGE)
- (*session)->internals.allow_cert_change = 1;
-
- if (flags & GNUTLS_ENABLE_FALSE_START)
- (*session)->internals.enable_false_start = 1;
+ (*session)->internals.flags = flags;
return 0;
}