mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 17:37:46 +00:00
[cli-tcp] fix bug causing "accept" action for all incoming connections (#8291)
This commit is contained in:
+2
-1
@@ -213,7 +213,7 @@ template <> otError TcpExample::Process<Cmd("connect")>(Arg aArgs[])
|
||||
VerifyOrExit(aArgs[2].IsEmpty(), error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
SuccessOrExit(error = otTcpConnect(&mEndpoint, &sockaddr, OT_TCP_CONNECT_NO_FAST_OPEN));
|
||||
mEndpointConnected = false;
|
||||
mEndpointConnected = true;
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -596,6 +596,7 @@ void TcpExample::HandleTcpAcceptDone(otTcpListener *aListener, otTcpEndpoint *aE
|
||||
OT_UNUSED_VARIABLE(aListener);
|
||||
OT_UNUSED_VARIABLE(aEndpoint);
|
||||
|
||||
mEndpointConnected = true;
|
||||
OutputFormat("Accepted connection from ");
|
||||
OutputSockAddrLine(*aPeer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user