take port numbers into account when finding a previous session from the

cache
This commit is contained in:
Daniel Stenberg 2001-08-29 09:36:41 +00:00
parent 8e0043165a
commit 26983053c4
2 changed files with 6 additions and 3 deletions

View File

@ -371,7 +371,8 @@ static int Get_SSL_Session(struct connectdata *conn,
if(!check->sessionid) if(!check->sessionid)
/* not session ID means blank entry */ /* not session ID means blank entry */
continue; continue;
if(strequal(conn->name, check->name)) { if(strequal(conn->name, check->name) &&
(conn->remote_port == check->remote_port) ) {
/* yes, we have a session ID! */ /* yes, we have a session ID! */
data->ssl.sessionage++; /* increase general age */ data->ssl.sessionage++; /* increase general age */
check->age = data->ssl.sessionage; /* set this as used in this age */ check->age = data->ssl.sessionage; /* set this as used in this age */
@ -459,6 +460,7 @@ static int Store_SSL_Session(struct connectdata *conn)
store->sessionid = ssl_sessionid; store->sessionid = ssl_sessionid;
store->age = data->ssl.sessionage; /* set current age */ store->age = data->ssl.sessionage; /* set current age */
store->name = strdup(conn->name); /* clone host name */ store->name = strdup(conn->name); /* clone host name */
store->remote_port = conn->remote_port; /* port number */
return 0; return 0;
} }

View File

@ -130,6 +130,7 @@ struct curl_ssl_session {
char *name; /* host name for which this ID was used */ char *name; /* host name for which this ID was used */
void *sessionid; /* as returned from the SSL layer */ void *sessionid; /* as returned from the SSL layer */
long age; /* just a number, the higher the more recent */ long age; /* just a number, the higher the more recent */
unsigned short remote_port; /* remote port to connect to */
}; };
struct ssl_config_data { struct ssl_config_data {