diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-07-15 11:51:51 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-07-15 11:51:51 +0200 |
commit | 98b6d3ecc833eaa8e21ee4ecc13e1f4d9a759ca0 (patch) | |
tree | 7d3a12cb32a68a82b2ffa552e6e8203662c95aca /lib/gnutls_int.h | |
parent | b1dab6d6387db3046bdc8a2b088d96015b3ccf3d (diff) | |
download | gnutls-98b6d3ecc833eaa8e21ee4ecc13e1f4d9a759ca0.tar.gz |
eliminated the need for the additional version variable.
Diffstat (limited to 'lib/gnutls_int.h')
-rw-r--r-- | lib/gnutls_int.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h index 180422a389..4ad22f42a7 100644 --- a/lib/gnutls_int.h +++ b/lib/gnutls_int.h @@ -569,7 +569,6 @@ typedef struct /* holds the negotiated certificate type */ gnutls_certificate_type_t cert_type; gnutls_ecc_curve_t ecc_curve; /* holds the first supported ECC curve requested by client */ - gnutls_protocol_t version; /* moved here */ /* Holds the signature algorithm used in this session - If any */ gnutls_sign_algorithm_t server_sign_algo; @@ -1043,11 +1042,16 @@ get_version (gnutls_session_t session) return session->security_parameters.pversion; } -#define get_num_version(session) \ - session->security_parameters.version +inline static unsigned +get_num_version (gnutls_session_t session) +{ + if (likely(session->security_parameters.pversion != NULL)) + return session->security_parameters.pversion->id; + else + return GNUTLS_VERSION_UNKNOWN; +} #define _gnutls_set_current_version(s, v) { \ - s->security_parameters.version = v; \ s->security_parameters.pversion = version_to_entry(v); \ } |