mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-22 21:23:07 +03:00
When the TCP socket is closed there may be some data left in the BearSSL internal buffers which can be read by the application. The BearSSL pump, however, would always return no data available in the case the socket was disconnected before checking if the SSL was in a state where the app could possibly read. Fix by returning if the state is available, even if the connection is gone. Eventually no more data will become available to read and the original -1 will be returned. This should match the existing axTLS ::connected() behavior.