diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-04-19 17:53:53 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-04-19 17:53:53 +0000 |
commit | e9fd9de3f0bca346fb21ca7b581389e6c681a587 (patch) | |
tree | 5be1e33a13ee305f7d2f33538c8d48c1d7165b97 /lib | |
parent | 20f48b0223fb9ef4ef75cf7524feb0c30d284707 (diff) | |
download | gnutls-e9fd9de3f0bca346fb21ca7b581389e6c681a587.tar.gz |
gnutls_session_resumed() was renamed to gnutls_session_is_resumed(), and changed semantics, to make the return value be the obvious one.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gnutls.h.in.in | 2 | ||||
-rw-r--r-- | lib/gnutls_state.c | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/gnutls.h.in.in b/lib/gnutls.h.in.in index 282afec7fb..52363381e4 100644 --- a/lib/gnutls.h.in.in +++ b/lib/gnutls.h.in.in @@ -169,7 +169,7 @@ int gnutls_session_get_id( GNUTLS_STATE state, void* session, int *session_size) /* checks if this session is a resumed one */ -int gnutls_session_resumed(GNUTLS_STATE state); +int gnutls_session_is_resumed(GNUTLS_STATE state); typedef int (*GNUTLS_DB_STORE_FUNC)(void*, gnutls_datum key, gnutls_datum data); typedef int (*GNUTLS_DB_REMOVE_FUNC)(void*, gnutls_datum key); diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c index b71a637f7a..498f39a5df 100644 --- a/lib/gnutls_state.c +++ b/lib/gnutls_state.c @@ -598,24 +598,24 @@ int _gnutls_PRF( opaque * secret, int secret_size, uint8 * label, int label_size } /** - * gnutls_session_resumed - Used to check whether this session is a resumed one + * gnutls_session_is_resumed - Used to check whether this session is a resumed one * @state: is a &GNUTLS_STATE structure. * - * This function will return 0 if this session is a resumed one, - * or a negative number if this is a new session. + * This function will return non zero if this session is a resumed one, + * or a zero if this is a new session. * **/ -int gnutls_session_resumed(GNUTLS_STATE state) +int gnutls_session_is_resumed(GNUTLS_STATE state) { if (state->security_parameters.entity==GNUTLS_CLIENT) { if (memcmp( state->security_parameters.session_id, state->gnutls_internals.resumed_security_parameters.session_id, state->security_parameters.session_id_size)==0) - return 0; + return 1; } else { if (state->gnutls_internals.resumed==RESUME_TRUE) - return 0; + return 1; } - return GNUTLS_E_UNKNOWN_ERROR; + return 0; } |