mirror of
https://github.com/curl/curl.git
synced 2026-07-24 15:57:18 +03:00
Cris Bailiff found out that when the SSL session cache was filled, libcurl
would crash. This corrects the problem.
This commit is contained in:
parent
d9a7c7de51
commit
d84a0c51e0
1 changed files with 3 additions and 2 deletions
|
|
@ -552,9 +552,9 @@ int Curl_SSL_Close_All(struct SessionHandle *data)
|
|||
static int Store_SSL_Session(struct connectdata *conn)
|
||||
{
|
||||
SSL_SESSION *ssl_sessionid;
|
||||
struct curl_ssl_session *store;
|
||||
int i;
|
||||
struct SessionHandle *data=conn->data; /* the mother of all structs */
|
||||
struct curl_ssl_session *store = &data->state.session[0];
|
||||
int oldest_age=data->state.session[0].age; /* zero if unused */
|
||||
|
||||
/* ask OpenSSL, say please */
|
||||
|
|
@ -568,7 +568,8 @@ static int Store_SSL_Session(struct connectdata *conn)
|
|||
the oldest if necessary) */
|
||||
|
||||
/* find an empty slot for us, or find the oldest */
|
||||
for(i=0; (i<data->set.ssl.numsessions) && data->state.session[i].sessionid; i++) {
|
||||
for(i=1; (i<data->set.ssl.numsessions) &&
|
||||
data->state.session[i].sessionid; i++) {
|
||||
if(data->state.session[i].age < oldest_age) {
|
||||
oldest_age = data->state.session[i].age;
|
||||
store = &data->state.session[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue