Explorar o código

Bug 1411: Consider port number for site-specific caches and bookmarks

https://winscp.net/tracker/1411

Source commit: 8acba9e7e986e42cb6d757242e09e44de5888c2a
Martin Prikryl %!s(int64=9) %!d(string=hai) anos
pai
achega
8360ad92a3
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      source/core/SessionData.cpp

+ 8 - 1
source/core/SessionData.cpp

@@ -1864,11 +1864,18 @@ bool __fastcall TSessionData::GetCanLogin()
 //---------------------------------------------------------------------------
 UnicodeString __fastcall TSessionData::GetSessionKey()
 {
-  return FORMAT(L"%s@%s", (UserName, HostName));
+  UnicodeString Result = FORMAT(L"%s@%s", (UserName, HostName));
+  if (PortNumber != DefaultPort(FSProtocol, Ftps))
+  {
+    Result += FORMAT(L":%d", (PortNumber));
+  }
+  return Result;
 }
 //---------------------------------------------------------------------
 UnicodeString __fastcall TSessionData::GetInternalStorageKey()
 {
+  // This is probably useless remnant of previous use of this method from OpenSessionInPutty
+  // that needs the method to return something even for ad-hoc sessions
   if (Name.IsEmpty())
   {
     return SessionKey;