int SSL_clear(SSL *s)
{
- int state;
if (s->method == NULL)
{
}
#endif
- state=s->state; /* Keep to check if we throw away the session-id */
s->type=0;
+ if (ssl_clear_bad_session(s))
+ {
+ SSL_SESSION_free(s->session);
+ s->session=NULL;
+ }
+
s->state=SSL_ST_BEFORE|((s->server)?SSL_ST_ACCEPT:SSL_ST_CONNECT);
s->version=s->method->version;
ssl_clear_cipher_ctx(s);
- if (ssl_clear_bad_session(s))
- {
- SSL_SESSION_free(s->session);
- s->session=NULL;
- }
-
s->first_packet=0;
#if 1