take port numbers into account when finding a previous session from the
cache
diff --git a/lib/ssluse.c b/lib/ssluse.c
index b8d91d5..730ae41 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -371,7 +371,8 @@
     if(!check->sessionid)
       /* not session ID means blank entry */
       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! */
       data->ssl.sessionage++;            /* increase general age */
       check->age = data->ssl.sessionage; /* set this as used in this age */
@@ -457,8 +458,9 @@
   
   /* now init the session struct wisely */
   store->sessionid = ssl_sessionid;
-  store->age = data->ssl.sessionage; /* set current age */
-  store->name = strdup(conn->name);   /* clone host name */
+  store->age = data->ssl.sessionage;      /* set current age */
+  store->name = strdup(conn->name);       /* clone host name */
+  store->remote_port = conn->remote_port; /* port number */
 
   return 0;
 }
diff --git a/lib/urldata.h b/lib/urldata.h
index 8f155e3..72e2881 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -130,6 +130,7 @@
   char *name;       /* host name for which this ID was used */
   void *sessionid;  /* as returned from the SSL layer */
   long age;         /* just a number, the higher the more recent */
+  unsigned short remote_port; /* remote port to connect to */
 };
 
 struct ssl_config_data {