Преглед изворни кода

Do not try to update network buffer, if there's no network socket

Source commit: c3ab4487d067b0f3dee0fe0b1d2d0664f922e279
Martin Prikryl пре 3 година
родитељ
комит
8c0e341973
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      source/core/SecureShell.cpp

+ 3 - 1
source/core/SecureShell.cpp

@@ -2056,6 +2056,7 @@ bool __fastcall TSecureShell::EventSelectLoop(unsigned int MSec, bool ReadEventR
           LogEvent(L"Detected network event");
         }
 
+        DebugAssert(FSocket != INVALID_SOCKET);
         if (Events == NULL)
         {
           if (ProcessNetworkEvents(FSocket))
@@ -2123,7 +2124,8 @@ bool __fastcall TSecureShell::EventSelectLoop(unsigned int MSec, bool ReadEventR
       }
     }
 
-    if ((FSendBuf > 0) && (TicksAfter - FLastSendBufferUpdate >= 1000))
+    if ((FSocket != INVALID_SOCKET) &&
+        (FSendBuf > 0) && (TicksAfter - FLastSendBufferUpdate >= 1000))
     {
       DWORD BufferLen = 0;
       DWORD OutLen = 0;