usrsock: update state to connected when recv sento ready under connecting
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
28180b49d1
commit
be06d00f85
@ -262,6 +262,12 @@ static ssize_t usrsock_handle_response(FAR struct usrsock_conn_s *conn,
|
||||
*/
|
||||
|
||||
conn->resp.inprogress = true;
|
||||
|
||||
/* This branch indicates successful processing and waiting
|
||||
* for USRSOCK_EVENT_CONNECT_READY event.
|
||||
*/
|
||||
|
||||
conn->resp.result = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -313,6 +319,13 @@ usrsock_handle_datareq_response(FAR struct usrsock_conn_s *conn,
|
||||
*/
|
||||
|
||||
conn->resp.inprogress = true;
|
||||
|
||||
/* This branch indicates successful processing and waiting
|
||||
* for USRSOCK_EVENT_CONNECT_READY event.
|
||||
*/
|
||||
|
||||
conn->resp.result = 0;
|
||||
|
||||
return sizeof(*datahdr);
|
||||
}
|
||||
|
||||
|
@ -67,9 +67,10 @@ int usrsock_event(FAR struct usrsock_conn_s *conn)
|
||||
|
||||
/* Generic state updates. */
|
||||
|
||||
if (events & USRSOCK_EVENT_REQ_COMPLETE)
|
||||
if (conn->state == USRSOCK_CONN_STATE_CONNECTING)
|
||||
{
|
||||
if (conn->state == USRSOCK_CONN_STATE_CONNECTING)
|
||||
if ((events & USRSOCK_EVENT_REQ_COMPLETE) ||
|
||||
(events & USRSOCK_EVENT_SENDTO_READY))
|
||||
{
|
||||
conn->state = USRSOCK_CONN_STATE_READY;
|
||||
events |= USRSOCK_EVENT_CONNECT_READY;
|
||||
|
Loading…
Reference in New Issue
Block a user