mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
webclient: Report unexpected connection loss as an explicit error
Otherwise, it can end up with mysterious results in user apps.
This commit is contained in:
parent
eceaeb926a
commit
ebe3b0d302
1 changed files with 7 additions and 0 deletions
|
|
@ -896,6 +896,13 @@ int webclient_perform(FAR struct webclient_context *ctx)
|
|||
}
|
||||
else if (ws->datend == 0)
|
||||
{
|
||||
if (ws->state != WEBCLIENT_STATE_DATA)
|
||||
{
|
||||
nerr("Connection lost unexpectedly\n");
|
||||
ret = -ECONNABORTED;
|
||||
goto errout_with_errno;
|
||||
}
|
||||
|
||||
ninfo("Connection lost\n");
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue