Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 1212289

Browse files
committed
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.
1 parent fd36085 commit 1212289

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/AsyncTCP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ void AsyncClient::_sockIsReadable(void)
898898

899899
void AsyncClient::_sockPoll(void)
900900
{
901-
if (_socket == -1) return;
901+
if (!connected()) return;
902902

903903
uint32_t now = millis();
904904

0 commit comments

Comments
 (0)