void *lh_delete(_LHASH *lh, const void *data)
	{
	unsigned long hash;
	LHASH_NODE *nn,**rn;
	void *ret;
	lh->error=0;
	rn=getrn(lh,data,&hash);
	if (*rn == NULL)
		{
		lh->num_no_delete++;
		return(NULL);
		}
	else
		{
		nn= *rn;
		*rn=nn->next;
		ret=nn->data;
		OPENSSL_free(nn);
		lh->num_delete++;
		}
	lh->num_items--;
	if ((lh->num_nodes > MIN_NODES) &&
		(lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
		contract(lh);
	return(ret);
	}
['int ssl3_get_client_hello(SSL *s)\n\t{\n\tint i,j,ok,al,ret= -1;\n\tunsigned int cookie_len;\n\tlong n;\n\tunsigned long id;\n\tunsigned char *p,*d,*q;\n\tSSL_CIPHER *c;\n#ifndef OPENSSL_NO_COMP\n\tSSL_COMP *comp=NULL;\n#endif\n\tSTACK_OF(SSL_CIPHER) *ciphers=NULL;\n\tif (s->state == SSL3_ST_SR_CLNT_HELLO_A\n\t\t)\n\t\t{\n\t\ts->state=SSL3_ST_SR_CLNT_HELLO_B;\n\t\t}\n\ts->first_packet=1;\n\tn=s->method->ssl_get_message(s,\n\t\tSSL3_ST_SR_CLNT_HELLO_B,\n\t\tSSL3_ST_SR_CLNT_HELLO_C,\n\t\tSSL3_MT_CLIENT_HELLO,\n\t\tSSL3_RT_MAX_PLAIN_LENGTH,\n\t\t&ok);\n\tif (!ok) return((int)n);\n\ts->first_packet=0;\n\td=p=(unsigned char *)s->init_msg;\n\ts->client_version=(((int)p[0])<<8)|(int)p[1];\n\tp+=2;\n\tif ((s->version == DTLS1_VERSION && s->client_version > s->version) ||\n\t    (s->version != DTLS1_VERSION && s->client_version < s->version))\n\t\t{\n\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_WRONG_VERSION_NUMBER);\n\t\tif ((s->client_version>>8) == SSL3_VERSION_MAJOR)\n\t\t\t{\n\t\t\ts->version = s->client_version;\n\t\t\t}\n\t\tal = SSL_AD_PROTOCOL_VERSION;\n\t\tgoto f_err;\n\t\t}\n\tif (SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE)\n\t\t{\n\t\tunsigned int session_length, cookie_length;\n\t\tsession_length = *(p + SSL3_RANDOM_SIZE);\n\t\tcookie_length = *(p + SSL3_RANDOM_SIZE + session_length + 1);\n\t\tif (cookie_length == 0)\n\t\t\treturn 1;\n\t\t}\n\tmemcpy(s->s3->client_random,p,SSL3_RANDOM_SIZE);\n\tp+=SSL3_RANDOM_SIZE;\n\tj= *(p++);\n\ts->hit=0;\n\tif ((s->new_session && (s->options & SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION)))\n\t\t{\n\t\tif (!ssl_get_new_session(s,1))\n\t\t\tgoto err;\n\t\t}\n\telse\n\t\t{\n\t\ti=ssl_get_prev_session(s, p, j, d + n);\n\t\tif (i == 1)\n\t\t\t{\n\t\t\ts->hit=1;\n\t\t\t}\n\t\telse if (i == -1)\n\t\t\tgoto err;\n\t\telse\n\t\t\t{\n\t\t\tif (!ssl_get_new_session(s,1))\n\t\t\t\tgoto err;\n\t\t\t}\n\t\t}\n\tp+=j;\n\tif (s->version == DTLS1_VERSION || s->version == DTLS1_BAD_VER)\n\t\t{\n\t\tcookie_len = *(p++);\n\t\tif ( cookie_len > sizeof(s->d1->rcvd_cookie))\n\t\t\t{\n\t\t\tal = SSL_AD_DECODE_ERROR;\n\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_COOKIE_MISMATCH);\n\t\t\tgoto f_err;\n\t\t\t}\n\t\tif ((SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE) &&\n\t\t\tcookie_len > 0)\n\t\t\t{\n\t\t\tmemcpy(s->d1->rcvd_cookie, p, cookie_len);\n\t\t\tif ( s->ctx->app_verify_cookie_cb != NULL)\n\t\t\t\t{\n\t\t\t\tif ( s->ctx->app_verify_cookie_cb(s, s->d1->rcvd_cookie,\n\t\t\t\t\tcookie_len) == 0)\n\t\t\t\t\t{\n\t\t\t\t\tal=SSL_AD_HANDSHAKE_FAILURE;\n\t\t\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,\n\t\t\t\t\t\tSSL_R_COOKIE_MISMATCH);\n\t\t\t\t\tgoto f_err;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse if ( memcmp(s->d1->rcvd_cookie, s->d1->cookie,\n\t\t\t\t\t\t  s->d1->cookie_len) != 0)\n\t\t\t\t{\n\t\t\t\t\tal=SSL_AD_HANDSHAKE_FAILURE;\n\t\t\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,\n\t\t\t\t\t\tSSL_R_COOKIE_MISMATCH);\n\t\t\t\t\tgoto f_err;\n\t\t\t\t}\n\t\t\tret = 2;\n\t\t\t}\n\t\tp += cookie_len;\n\t\t}\n\tn2s(p,i);\n\tif ((i == 0) && (j != 0))\n\t\t{\n\t\tal=SSL_AD_ILLEGAL_PARAMETER;\n\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_NO_CIPHERS_SPECIFIED);\n\t\tgoto f_err;\n\t\t}\n\tif ((p+i) >= (d+n))\n\t\t{\n\t\tal=SSL_AD_DECODE_ERROR;\n\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_LENGTH_MISMATCH);\n\t\tgoto f_err;\n\t\t}\n\tif ((i > 0) && (ssl_bytes_to_cipher_list(s,p,i,&(ciphers))\n\t\t== NULL))\n\t\t{\n\t\tgoto err;\n\t\t}\n\tp+=i;\n\tif ((s->hit) && (i > 0))\n\t\t{\n\t\tj=0;\n\t\tid=s->session->cipher->id;\n#ifdef CIPHER_DEBUG\n\t\tprintf("client sent %d ciphers\\n",sk_num(ciphers));\n#endif\n\t\tfor (i=0; i<sk_SSL_CIPHER_num(ciphers); i++)\n\t\t\t{\n\t\t\tc=sk_SSL_CIPHER_value(ciphers,i);\n#ifdef CIPHER_DEBUG\n\t\t\tprintf("client [%2d of %2d]:%s\\n",\n\t\t\t\ti,sk_num(ciphers),SSL_CIPHER_get_name(c));\n#endif\n\t\t\tif (c->id == id)\n\t\t\t\t{\n\t\t\t\tj=1;\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n#if 0\n\t\tif (j == 0 && (s->options & SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG) && (sk_SSL_CIPHER_num(ciphers) == 1))\n\t\t\t{\n\t\t\tc = sk_SSL_CIPHER_value(ciphers, 0);\n\t\t\tif (sk_SSL_CIPHER_find(SSL_get_ciphers(s), c) >= 0)\n\t\t\t\t{\n\t\t\t\ts->session->cipher = c;\n\t\t\t\tj = 1;\n\t\t\t\t}\n\t\t\t}\n#endif\n\t\tif (j == 0)\n\t\t\t{\n\t\t\tal=SSL_AD_ILLEGAL_PARAMETER;\n\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_REQUIRED_CIPHER_MISSING);\n\t\t\tgoto f_err;\n\t\t\t}\n\t\t}\n\ti= *(p++);\n\tif ((p+i) > (d+n))\n\t\t{\n\t\tal=SSL_AD_DECODE_ERROR;\n\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_LENGTH_MISMATCH);\n\t\tgoto f_err;\n\t\t}\n\tq=p;\n\tfor (j=0; j<i; j++)\n\t\t{\n\t\tif (p[j] == 0) break;\n\t\t}\n\tp+=i;\n\tif (j >= i)\n\t\t{\n\t\tal=SSL_AD_DECODE_ERROR;\n\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_NO_COMPRESSION_SPECIFIED);\n\t\tgoto f_err;\n\t\t}\n#ifndef OPENSSL_NO_TLSEXT\n\tif (s->version >= SSL3_VERSION)\n\t\t{\n\t\tif (!ssl_parse_clienthello_tlsext(s,&p,d,n, &al))\n\t\t\t{\n\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_PARSE_TLSEXT);\n\t\t\tgoto f_err;\n\t\t\t}\n\t\t}\n\t\tif (ssl_check_clienthello_tlsext_early(s) <= 0) {\n\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_CLIENTHELLO_TLSEXT);\n\t\t\tgoto err;\n\t\t}\n\t{\n\t\tunsigned long Time;\n\t\tunsigned char *pos;\n\t\tTime=(unsigned long)time(NULL);\n\t\tpos=s->s3->server_random;\n\t\tl2n(Time,pos);\n\t\tif (RAND_pseudo_bytes(pos,SSL3_RANDOM_SIZE-4) <= 0)\n\t\t\t{\n\t\t\tal=SSL_AD_INTERNAL_ERROR;\n\t\t\tgoto f_err;\n\t\t\t}\n\t}\n\tif (!s->hit && s->version >= TLS1_VERSION && s->tls_session_secret_cb)\n\t\t{\n\t\tSSL_CIPHER *pref_cipher=NULL;\n\t\ts->session->master_key_length=sizeof(s->session->master_key);\n\t\tif(s->tls_session_secret_cb(s, s->session->master_key, &s->session->master_key_length,\n\t\t\tciphers, &pref_cipher, s->tls_session_secret_cb_arg))\n\t\t\t{\n\t\t\ts->hit=1;\n\t\t\ts->session->ciphers=ciphers;\n\t\t\ts->session->verify_result=X509_V_OK;\n\t\t\tciphers=NULL;\n\t\t\tpref_cipher=pref_cipher ? pref_cipher : ssl3_choose_cipher(s, s->session->ciphers, SSL_get_ciphers(s));\n\t\t\tif (pref_cipher == NULL)\n\t\t\t\t{\n\t\t\t\tal=SSL_AD_HANDSHAKE_FAILURE;\n\t\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_NO_SHARED_CIPHER);\n\t\t\t\tgoto f_err;\n\t\t\t\t}\n\t\t\ts->session->cipher=pref_cipher;\n\t\t\tif (s->cipher_list)\n\t\t\t\tsk_SSL_CIPHER_free(s->cipher_list);\n\t\t\tif (s->cipher_list_by_id)\n\t\t\t\tsk_SSL_CIPHER_free(s->cipher_list_by_id);\n\t\t\ts->cipher_list = sk_SSL_CIPHER_dup(s->session->ciphers);\n\t\t\ts->cipher_list_by_id = sk_SSL_CIPHER_dup(s->session->ciphers);\n\t\t\t}\n\t\t}\n#endif\n\ts->s3->tmp.new_compression=NULL;\n#ifndef OPENSSL_NO_COMP\n\tif (s->session->compress_meth != 0)\n\t\t{\n\t\tint m, comp_id = s->session->compress_meth;\n\t\tif (s->options & SSL_OP_NO_COMPRESSION)\n\t\t\t{\n\t\t\tal=SSL_AD_INTERNAL_ERROR;\n\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_INCONSISTENT_COMPRESSION);\n\t\t\tgoto f_err;\n\t\t\t}\n\t\tfor (m = 0; m < sk_SSL_COMP_num(s->ctx->comp_methods); m++)\n\t\t\t{\n\t\t\tcomp=sk_SSL_COMP_value(s->ctx->comp_methods,m);\n\t\t\tif (comp_id == comp->id)\n\t\t\t\t{\n\t\t\t\ts->s3->tmp.new_compression=comp;\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\tif (s->s3->tmp.new_compression == NULL)\n\t\t\t{\n\t\t\tal=SSL_AD_INTERNAL_ERROR;\n\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_INVALID_COMPRESSION_ALGORITHM);\n\t\t\tgoto f_err;\n\t\t\t}\n\t\tfor (m = 0; m < i; m++)\n\t\t\t{\n\t\t\tif (q[m] == comp_id)\n\t\t\t\tbreak;\n\t\t\t}\n\t\tif (m >= i)\n\t\t\t{\n\t\t\tal=SSL_AD_ILLEGAL_PARAMETER;\n\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING);\n\t\t\tgoto f_err;\n\t\t\t}\n\t\t}\n\telse if (s->hit)\n\t\tcomp = NULL;\n\telse if (!(s->options & SSL_OP_NO_COMPRESSION) && s->ctx->comp_methods)\n\t\t{\n\t\tint m,nn,o,v,done=0;\n\t\tnn=sk_SSL_COMP_num(s->ctx->comp_methods);\n\t\tfor (m=0; m<nn; m++)\n\t\t\t{\n\t\t\tcomp=sk_SSL_COMP_value(s->ctx->comp_methods,m);\n\t\t\tv=comp->id;\n\t\t\tfor (o=0; o<i; o++)\n\t\t\t\t{\n\t\t\t\tif (v == q[o])\n\t\t\t\t\t{\n\t\t\t\t\tdone=1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (done) break;\n\t\t\t}\n\t\tif (done)\n\t\t\ts->s3->tmp.new_compression=comp;\n\t\telse\n\t\t\tcomp=NULL;\n\t\t}\n#else\n\tif (s->session->compress_meth != 0)\n\t\t{\n\t\tal=SSL_AD_INTERNAL_ERROR;\n\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_INCONSISTENT_COMPRESSION);\n\t\tgoto f_err;\n\t\t}\n#endif\n\tif (!s->hit)\n\t\t{\n#ifdef OPENSSL_NO_COMP\n\t\ts->session->compress_meth=0;\n#else\n\t\ts->session->compress_meth=(comp == NULL)?0:comp->id;\n#endif\n\t\tif (s->session->ciphers != NULL)\n\t\t\tsk_SSL_CIPHER_free(s->session->ciphers);\n\t\ts->session->ciphers=ciphers;\n\t\tif (ciphers == NULL)\n\t\t\t{\n\t\t\tal=SSL_AD_ILLEGAL_PARAMETER;\n\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_NO_CIPHERS_PASSED);\n\t\t\tgoto f_err;\n\t\t\t}\n\t\tciphers=NULL;\n\t\tc=ssl3_choose_cipher(s,s->session->ciphers,\n\t\t\t\t     SSL_get_ciphers(s));\n\t\tif (c == NULL)\n\t\t\t{\n\t\t\tal=SSL_AD_HANDSHAKE_FAILURE;\n\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_NO_SHARED_CIPHER);\n\t\t\tgoto f_err;\n\t\t\t}\n\t\ts->s3->tmp.new_cipher=c;\n\t\t}\n\telse\n\t\t{\n#ifdef REUSE_CIPHER_BUG\n\t\tSTACK_OF(SSL_CIPHER) *sk;\n\t\tSSL_CIPHER *nc=NULL;\n\t\tSSL_CIPHER *ec=NULL;\n\t\tif (s->options & SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG)\n\t\t\t{\n\t\t\tsk=s->session->ciphers;\n\t\t\tfor (i=0; i<sk_SSL_CIPHER_num(sk); i++)\n\t\t\t\t{\n\t\t\t\tc=sk_SSL_CIPHER_value(sk,i);\n\t\t\t\tif (c->algorithm_enc & SSL_eNULL)\n\t\t\t\t\tnc=c;\n\t\t\t\tif (SSL_C_IS_EXPORT(c))\n\t\t\t\t\tec=c;\n\t\t\t\t}\n\t\t\tif (nc != NULL)\n\t\t\t\ts->s3->tmp.new_cipher=nc;\n\t\t\telse if (ec != NULL)\n\t\t\t\ts->s3->tmp.new_cipher=ec;\n\t\t\telse\n\t\t\t\ts->s3->tmp.new_cipher=s->session->cipher;\n\t\t\t}\n\t\telse\n#endif\n\t\ts->s3->tmp.new_cipher=s->session->cipher;\n\t\t}\n\tif (TLS1_get_version(s) < TLS1_2_VERSION || !(s->verify_mode & SSL_VERIFY_PEER))\n\t\t{\n\t\tif (!ssl3_digest_cached_records(s))\n\t\t\t{\n\t\t\tal = SSL_AD_INTERNAL_ERROR;\n\t\t\tgoto f_err;\n\t\t\t}\n\t\t}\n\tif (s->version >= SSL3_VERSION)\n\t\t{\n\t\tif (ssl_check_clienthello_tlsext_late(s) <= 0)\n\t\t\t{\n\t\t\tSSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_CLIENTHELLO_TLSEXT);\n\t\t\tgoto err;\n\t\t\t}\n\t\t}\n\tif (ret < 0) ret=1;\n\tif (0)\n\t\t{\nf_err:\n\t\tssl3_send_alert(s,SSL3_AL_FATAL,al);\n\t\t}\nerr:\n\tif (ciphers != NULL) sk_SSL_CIPHER_free(ciphers);\n\treturn(ret);\n\t}', 'int ssl_check_clienthello_tlsext_early(SSL *s)\n\t{\n\tint ret=SSL_TLSEXT_ERR_NOACK;\n\tint al = SSL_AD_UNRECOGNIZED_NAME;\n#ifndef OPENSSL_NO_EC\n#endif\n\tif (s->ctx != NULL && s->ctx->tlsext_servername_callback != 0)\n\t\tret = s->ctx->tlsext_servername_callback(s, &al, s->ctx->tlsext_servername_arg);\n\telse if (s->initial_ctx != NULL && s->initial_ctx->tlsext_servername_callback != 0)\n\t\tret = s->initial_ctx->tlsext_servername_callback(s, &al, s->initial_ctx->tlsext_servername_arg);\n#ifdef TLSEXT_TYPE_opaque_prf_input\n \t{\n\t\tint r = 1;\n\t\tif (s->ctx->tlsext_opaque_prf_input_callback != 0)\n\t\t\t{\n\t\t\tr = s->ctx->tlsext_opaque_prf_input_callback(s, NULL, 0, s->ctx->tlsext_opaque_prf_input_callback_arg);\n\t\t\tif (!r)\n\t\t\t\t{\n\t\t\t\tret = SSL_TLSEXT_ERR_ALERT_FATAL;\n\t\t\t\tal = SSL_AD_INTERNAL_ERROR;\n\t\t\t\tgoto err;\n\t\t\t\t}\n\t\t\t}\n\t\tif (s->s3->server_opaque_prf_input != NULL)\n\t\t\tOPENSSL_free(s->s3->server_opaque_prf_input);\n\t\ts->s3->server_opaque_prf_input = NULL;\n\t\tif (s->tlsext_opaque_prf_input != NULL)\n\t\t\t{\n\t\t\tif (s->s3->client_opaque_prf_input != NULL &&\n\t\t\t\ts->s3->client_opaque_prf_input_len == s->tlsext_opaque_prf_input_len)\n\t\t\t\t{\n\t\t\t\tif (s->tlsext_opaque_prf_input_len == 0)\n\t\t\t\t\ts->s3->server_opaque_prf_input = OPENSSL_malloc(1);\n\t\t\t\telse\n\t\t\t\t\ts->s3->server_opaque_prf_input = BUF_memdup(s->tlsext_opaque_prf_input, s->tlsext_opaque_prf_input_len);\n\t\t\t\tif (s->s3->server_opaque_prf_input == NULL)\n\t\t\t\t\t{\n\t\t\t\t\tret = SSL_TLSEXT_ERR_ALERT_FATAL;\n\t\t\t\t\tal = SSL_AD_INTERNAL_ERROR;\n\t\t\t\t\tgoto err;\n\t\t\t\t\t}\n\t\t\t\ts->s3->server_opaque_prf_input_len = s->tlsext_opaque_prf_input_len;\n\t\t\t\t}\n\t\t\t}\n\t\tif (r == 2 && s->s3->server_opaque_prf_input == NULL)\n\t\t\t{\n\t\t\tret = SSL_TLSEXT_ERR_ALERT_FATAL;\n\t\t\tal = SSL_AD_HANDSHAKE_FAILURE;\n\t\t\t}\n\t}\n err:\n#endif\n\tswitch (ret)\n\t\t{\n\t\tcase SSL_TLSEXT_ERR_ALERT_FATAL:\n\t\t\tssl3_send_alert(s,SSL3_AL_FATAL,al);\n\t\t\treturn -1;\n\t\tcase SSL_TLSEXT_ERR_ALERT_WARNING:\n\t\t\tssl3_send_alert(s,SSL3_AL_WARNING,al);\n\t\t\treturn 1;\n\t\tcase SSL_TLSEXT_ERR_NOACK:\n\t\t\ts->servername_done=0;\n\t\t\tdefault:\n\t\treturn 1;\n\t\t}\n\t}', 'int ssl3_send_alert(SSL *s, int level, int desc)\n\t{\n\tdesc=s->method->ssl3_enc->alert_value(desc);\n\tif (s->version == SSL3_VERSION && desc == SSL_AD_PROTOCOL_VERSION)\n\t\tdesc = SSL_AD_HANDSHAKE_FAILURE;\n\tif (desc < 0) return -1;\n\tif ((level == 2) && (s->session != NULL))\n\t\tSSL_CTX_remove_session(s->ctx,s->session);\n\ts->s3->alert_dispatch=1;\n\ts->s3->send_alert[0]=level;\n\ts->s3->send_alert[1]=desc;\n\tif (s->s3->wbuf.left == 0)\n\t\treturn s->method->ssl_dispatch_alert(s);\n\treturn -1;\n\t}', 'int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)\n{\n\treturn remove_session_lock(ctx, c, 1);\n}', 'static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)\n\t{\n\tSSL_SESSION *r;\n\tint ret=0;\n\tif ((c != NULL) && (c->session_id_length != 0))\n\t\t{\n\t\tif(lck) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX);\n\t\tif ((r = lh_SSL_SESSION_retrieve(ctx->sessions,c)) == c)\n\t\t\t{\n\t\t\tret=1;\n\t\t\tr=lh_SSL_SESSION_delete(ctx->sessions,c);\n\t\t\tSSL_SESSION_list_remove(ctx,c);\n\t\t\t}\n\t\tif(lck) CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX);\n\t\tif (ret)\n\t\t\t{\n\t\t\tr->not_resumable=1;\n\t\t\tif (ctx->remove_session_cb != NULL)\n\t\t\t\tctx->remove_session_cb(ctx,r);\n\t\t\tSSL_SESSION_free(r);\n\t\t\t}\n\t\t}\n\telse\n\t\tret=0;\n\treturn(ret);\n\t}', 'void *lh_delete(_LHASH *lh, const void *data)\n\t{\n\tunsigned long hash;\n\tLHASH_NODE *nn,**rn;\n\tvoid *ret;\n\tlh->error=0;\n\trn=getrn(lh,data,&hash);\n\tif (*rn == NULL)\n\t\t{\n\t\tlh->num_no_delete++;\n\t\treturn(NULL);\n\t\t}\n\telse\n\t\t{\n\t\tnn= *rn;\n\t\t*rn=nn->next;\n\t\tret=nn->data;\n\t\tOPENSSL_free(nn);\n\t\tlh->num_delete++;\n\t\t}\n\tlh->num_items--;\n\tif ((lh->num_nodes > MIN_NODES) &&\n\t\t(lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))\n\t\tcontract(lh);\n\treturn(ret);\n\t}']