Skip to content

Commit

Permalink
XAsynchSockets: Add security to free bad scokets
Browse files Browse the repository at this point in the history
  • Loading branch information
jczic committed Mar 5, 2024
1 parent 70fb8dd commit c3c2229
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MicroWebSrv2/libs/XAsyncSockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def jobReadyForReading(args) :
self._udpSockEvt.recv_into(udpSockEvtBuf)
else :
asyncSocket = self._asyncSockets.get(sock.fileno())
if asyncSocket :
if asyncSocket and asyncSocket.GetSocketObj() == sock :
if self._socketListAdd(sock, self._handlingList) :
if socketsList is rd :
if self._microWorkers :
Expand Down Expand Up @@ -691,6 +691,7 @@ def OnReadyForReading(self) :
if not self.IsSSL or self._socket.pending() == 0 :
return
else :
self._asyncSocketsPool.NotifyNextReadyForReading(self, False)
return

# ------------------------------------------------------------------------
Expand Down Expand Up @@ -825,6 +826,8 @@ def _doSSLHandshake(self) :
raise XAsyncTCPClientException('SSL : Bad handshake : %s' % sslErr)
except Exception as ex :
raise XAsyncTCPClientException('SSL : Handshake error : %s' % ex)
else :
raise XAsyncTCPClientException('SSL : Handshake error')

# ------------------------------------------------------------------------

Expand Down

0 comments on commit c3c2229

Please sign in to comment.