Skip onPoll processing until socket is fully connected

Previously there was a risk that an in-progress connection with a valid
socket would be selected for polling and its installed onPoll callback
invoked before the onConnect event arrives, resulting in potentially
undefined behavior. Fixed by use of the standard connected() method.
This commit is contained in:
Alex Villacís Lasso
2022-10-28 14:01:55 -05:00
parent fd36085b1d
commit 1212289f0b

View File

@@ -898,7 +898,7 @@ void AsyncClient::_sockIsReadable(void)
void AsyncClient::_sockPoll(void)
{
if (_socket == -1) return;
if (!connected()) return;
uint32_t now = millis();